コード例 #1
0
 async def each_commands_list(self, menu: MenuBase, entries):
     offset = menu.current_page * self.per_page
     embed = BaseEmbed(title=f"All Commands")
     key = "(\u200b|\u200b)"
     contents = [
         "`{i}. {command}{k}{command_count}`".format(i=i, k=key, **b)
         for i, b in enumerate(entries, start=offset + 1)
     ]
     embed.description = "\n".join(realign(contents, key))
     return embed
コード例 #2
0
ファイル: game_classes.py プロジェクト: InterStella0/lila
 async def end_message(self, message, **kwargs):
     self.ended_at = datetime.datetime.utcnow()
     display = await self.render_board()
     file = discord.File(display, filename="connect_4.png")
     embed = BaseEmbed(timestamp=self.ended_at, **kwargs)
     embed.title = self.game
     embed.description = message
     embed.set_image(url=f"attachment://{file.filename}")
     embed.set_footer(text=self.GAME_TIME.format(precisedelta(self.ended_at - self.created_at)))
     return {"embed": embed, "file": file}