private function getUserTimeZones() { $DbUser = new User($this->db); if ($this->Message->Chat->id == '56390227') { $users = $DbUser->getAllUsersInChat('-1001033369096'); } else { $users = $DbUser->getAllUsersInChat($this->Message->Chat->id); } $timezones = []; foreach ($users as $user) { if (isset($user->timezone)) { $timezones[$user->timezone][] = $user->getName(); } } $timezones['Australia/Perth'][] = 'ShitBot'; return $timezones; }
private function losePopularity() { $this->out .= "\n" . emoji(0x1f465) . " Sickening groans surround you, as corpses rise from the earth. "; $Vote = new Vote($this->db); $DbUser = new User($this->db); $users_in_chat = $DbUser->getAllUsersInChat($this->Message->Chat->id); foreach ($users_in_chat as $user) { if ($user->user_id != $this->Message->User->user_id) { $userVote = new UserVote(); $userVote->construct($user, $this->Message->User, new VoteType(VoteType::Down)); $Vote->SQL->update_vote($userVote); } } $this->out .= "\n*" . $this->Message->User->getName() . "*, you become very unpopular. "; }