1
0
Fork 0
mirror of synced 2024-06-03 03:04:33 +12:00

Changed the info command to use the new embed system

This commit is contained in:
Phxntxm 2016-11-20 19:27:34 -06:00
parent 766cd6f004
commit 2b85dabb15

View file

@ -119,39 +119,38 @@ class Core:
total_data['member_count'] += entry['member_count'] total_data['member_count'] += entry['member_count']
total_data['server_count'] += entry['server_count'] total_data['server_count'] += entry['server_count']
fmt['Official Bot Server'] = config.dev_server # Create the original embed object
fmt['Uptime'] = (pendulum.utcnow() - self.bot.uptime).in_words() opts = {'title': 'Dev Server',
fmt['Total Servers'] = total_data.get('server_count') 'description': 'Join the server above for any questions/suggestions about me.'
fmt['Total Members'] = total_data.get('member_count') 'url': config.dev_server}
fmt['Description'] = self.bot.description embed = discord.Embed(**opts)
# servers_playing_music = len([server_id for server_id, state in self.bot.get_cog('Music').voice_states.items() # Add the normal values
# if state.is_playing()]) embed.add_field(name='Uptime', value=(pendulum.utcnow() - self.bot.uptime).in_words())
embed.add_field(name='Total Servers', value=total_data['server_count'])
embed.add_field(name='Total Members', value=total_data['member_count'])
# Count the variable values; hangman, tictactoe, etc.
hm_games = len( hm_games = len(
[server_id for server_id, game in self.bot.get_cog('Hangman').games.items()]) [server_id for server_id, game in self.bot.get_cog('Hangman').games.items()])
ttt_games = len([server_id for server_id, ttt_games = len([server_id for server_id,
game in self.bot.get_cog('TicTacToe').boards.items()]) game in self.bot.get_cog('TicTacToe').boards.items()])
count_battles = 0 count_battles = 0
for battles in self.bot.get_cog('Interaction').battles.values(): for battles in self.bot.get_cog('Interaction').battles.values():
count_battles += len(battles) count_battles += len(battles)
information = "\n".join("{}: {}".format(key, result)
for key, result in fmt.items())
information += "\n"
# if servers_playing_music:
# information += "Playing songs in {} different servers\n".format(
# servers_playing_music)
if hm_games: if hm_games:
information += "{} different hangman games running\n".format( embed.add_field(text='Total Hangman games running', value=hm_games)
hm_games)
if ttt_games: if ttt_games:
information += "{} different TicTacToe games running\n".format( embed.add_field(text='Total TicTacToe games running', value=ttt_games)
ttt_games)
if count_battles: if count_battles:
information += "{} different battles going on\n".format( embed.add_field(text='Total battles games running', value=count_battles)
count_battles)
await self.bot.say("```\n{}```".format(information)) embed.set_footer(text=self.bot.description)
await self.bot.say(embed=embed)
@commands.command() @commands.command()
@checks.custom_perms(send_messages=True) @checks.custom_perms(send_messages=True)