async def displayStatus(self, message): text = "" attributes = ['rank','username','fullname','sent_rankings','messageCount', 'wordCount', 'refreshTimer','lastReaction','voted_today','status','perks'] attributes = ['rank','username','fullname','sent_rankings','messageCount', 'wordCount', 'refreshTimer','lastReaction','voted_today'] for attribute in attributes: value = getattr(self, attribute) text += f"{attribute}: {value}\n" text += "\n" for key in self.perks.keys(): value = self.perks[key] text += f"{key}: {value}\n" text += "\n" for key in self.status.keys(): value = self.status[key] text += f"{key}: {value}" # if type(value) == dict: # if attribute == "perks": # text += attribute + "\n" # for perkname in value.keys(): # text += f'{perkname}:{value[perkname]}\n' # else: # text += f"\n{attribute}:\n{value} \n" # else: # text += f"{attribute} = {value}\n" await message.answer(text, disable_notification=True, parse_mode="html")