Beispiel #1
0
 def get_all_settings(self, chat_id):
     group = self.db["groups"].find_one({"id": chat_id})
     if not group:
         self.db["groups"].insert_one(vars(objects.Group(chat_id)))
         group = vars(objects.Group(chat_id))
     entries_to_remove = {"id", "games_played", "_id"}
     for k in entries_to_remove:
         group.pop(k, None)
     return group
Beispiel #2
0
 def get_language_chat(self, chat_id):
     group = self.db["groups"].find_one({"id": chat_id})
     if group:
         return group["lang"]
     else:
         self.db["groups"].insert_one(vars(objects.Group(chat_id)))
         return "en"