public function sendReminders() { $reminders = $this->SQL->select_reminders(); $UserDb = new User($this->db); /** @var Reminder $reminder */ foreach ($reminders as $reminder) { $date_due = Carbon::parse($reminder->date_due); $date_created = Carbon::parse($reminder->date_created); if ($date_due->lte(Carbon::now())) { $user = $UserDb->getUserFromId($reminder->user_id); $out = emoji(0x23f0) . " *" . $user->getName() . "*, your reminder from *" . $date_created->diffForHumans(Carbon::now(), true) . "* ago:" . "\n" . "\n`" . $reminder->content . "`"; Telegram::talkForced($reminder->chat_id, $out); $this->SQL->delete_reminder($reminder); } } }
public function main() { $RussianRoulette = new RussianRoulette($this->db, $this->Message->Chat->id, $this->Message->User->user_id); if ($RussianRoulette->isLoaded()) { if ($RussianRoulette->trigger()) { $out = emoji(0x1f4a5) . emoji(0x1f52b) . "\n" . "\n" . emoji(0x2620) . " *" . $this->Message->User->getName() . "* killed themselves." . "\n /reload to play again."; Telegram::talkForced($this->Message->Chat->id, $out); //Telegram::kick($this->Message->Chat->id, $this->Message->User->user_id); } else { $out = $this->getFace() . emoji(0x1f52b) . " `Click.`"; Telegram::talk($this->Message->Chat->id, $out); } } else { $out = emoji(0x1f449) . " The revolver isn't loaded. Use /reload first."; Telegram::talk($this->Message->Chat->id, $out); } }
public function main() { $out = Telegram::kick2($this->Message->Chat->id, $this->Message->User->user_id); Telegram::talkForced($this->Message->Chat->id, print_r($out, true)); }