private function all_options() { $DbChat = new Chat($this->db); $this->out .= emoji(0x2699) . " Hi *" . $this->Message->User->getName() . "*." . "\n\nYou can access the following personal preferences:" . "\n` `• Change how your name is displayed"; $this->keyboard = [[['text' => 'Change name', 'callback_data' => '/preferences name']]]; if ($chats = $DbChat->getChatsByAdmin($this->Message->User->user_id)) { $this->out .= "\n" . "\nYou're my admin for the following chats:"; $keyboard = []; foreach ($chats as $index => $chat) { $this->out .= "\n` `• `" . $chat->title . "`"; $keyboard[] = ['text' => $chat->title, 'callback_data' => '/preferences chat ' . $chat->id]; if ($index != 0 && $index % 4 == 0) { $this->keyboard[] = $keyboard; $keyboard = []; } } if (isset($keyboard)) { $this->keyboard[] = $keyboard; } $this->out .= "\n" . "\nPlease click on a chat name below to change its settings."; } $this->keyboard[] = [['text' => emoji(0x1f6aa) . ' Back to main menu', 'callback_data' => '/help']]; }