diff --git a/cogs/basic.py b/cogs/basic.py index 3ece545..2ace025 100644 --- a/cogs/basic.py +++ b/cogs/basic.py @@ -27,29 +27,11 @@ class Basic(Cog): """Converts base 10 to 16""" await ctx.send(f"{ctx.author.mention}: {int(num, 16)}") - @commands.guild_only() - @commands.command() - async def communitycount(self, ctx): - """Prints the community member count of the server.""" - community = ctx.guild.get_role(config.named_roles["community"]) - await ctx.send( - f"{ctx.guild.name} has " f"{len(community.members)} community members!" - ) - - @commands.guild_only() - @commands.command() - async def hackercount(self, ctx): - """Prints the hacker member count of the server.""" - h4x0r = ctx.guild.get_role(config.named_roles["hacker"]) - await ctx.send( - f"{ctx.guild.name} has " f"{len(h4x0r.members)} people with hacker role!" - ) - @commands.guild_only() @commands.command() async def membercount(self, ctx): """Prints the member count of the server.""" - await ctx.send(f"{ctx.guild.name} has " f"{ctx.guild.member_count} members!") + await ctx.send(f"{ctx.guild.name} has {ctx.guild.member_count} members!") @commands.command(aliases=["robocopng", "robocop-ng"]) async def robocop(self, ctx): @@ -75,7 +57,7 @@ class Basic(Cog): gw_ms = self.bot.latency * 1000 message_text = ( - f":ping_pong:\n" f"rtt: `{rtt_ms:.1f}ms`\n" f"gw: `{gw_ms:.1f}ms`" + f":ping_pong:\nrtt: `{rtt_ms:.1f}ms`\ngw: `{gw_ms:.1f}ms`" ) self.bot.log.info(message_text) await tmp.edit(content=message_text) diff --git a/cogs/basic_reswitched.py b/cogs/basic_reswitched.py new file mode 100644 index 0000000..bf2b6ee --- /dev/null +++ b/cogs/basic_reswitched.py @@ -0,0 +1,30 @@ +import config +from discord.ext import commands +from discord.ext.commands import Cog + + +class BasicReswitched(Cog): + def __init__(self, bot): + self.bot = bot + + @commands.guild_only() + @commands.command() + async def communitycount(self, ctx): + """Prints the community member count of the server.""" + community = ctx.guild.get_role(config.named_roles["community"]) + await ctx.send( + f"{ctx.guild.name} has {len(community.members)} community members!" + ) + + @commands.guild_only() + @commands.command() + async def hackercount(self, ctx): + """Prints the hacker member count of the server.""" + h4x0r = ctx.guild.get_role(config.named_roles["hacker"]) + await ctx.send( + f"{ctx.guild.name} has {len(h4x0r.members)} people with hacker role!" + ) + + +def setup(bot): + bot.add_cog(BasicReswitched(bot)) diff --git a/cogs/robocronp.py b/cogs/robocronp.py index 604d9e4..47c32a0 100644 --- a/cogs/robocronp.py +++ b/cogs/robocronp.py @@ -35,7 +35,7 @@ class Robocronp(Cog): job_details = repr(ctab[jobtype][jobtimestamp][job_name]) embed.add_field( name=f"{jobtype} for {job_name}", - value=f"Timestamp: {jobtimestamp}, " f"Details: {job_details}", + value=f"Timestamp: {jobtimestamp}, Details: {job_details}", inline=False, ) await ctx.send(embed=embed) @@ -82,7 +82,7 @@ class Robocronp(Cog): target = await self.bot.fetch_user(int(job_name)) if target: await target.send( - "You asked to be reminded about" f" `{text}` on {added_on}." + f"You asked to be reminded about `{text}` on {added_on}." ) delete_job(timestamp, jobtype, job_name) except: @@ -105,12 +105,12 @@ class Robocronp(Cog): if len(purge_res) != 100: done_cleaning = True await log_channel.send( - f"Wiped {count} messages from " f"<#{channel.id}> automatically." + f"Wiped {count} messages from <#{channel.id}> automatically." ) except: # Don't kill cronjobs if something goes wrong. await log_channel.send( - "Cronclean has errored: ```" f"{traceback.format_exc()}```" + f"Cronclean has errored: ```{traceback.format_exc()}```" ) async def minutely(self): @@ -131,7 +131,7 @@ class Robocronp(Cog): except: # Don't kill cronjobs if something goes wrong. await log_channel.send( - "Cron-minutely has errored: ```" f"{traceback.format_exc()}```" + f"Cron-minutely has errored: ```{traceback.format_exc()}```" ) await asyncio.sleep(60) @@ -151,7 +151,7 @@ class Robocronp(Cog): except: # Don't kill cronjobs if something goes wrong. await log_channel.send( - "Cron-hourly has errored: ```" f"{traceback.format_exc()}```" + f"Cron-hourly has errored: ```{traceback.format_exc()}```" ) # Your stuff that should run an hour after boot # and after that every hour goes here @@ -170,7 +170,7 @@ class Robocronp(Cog): except: # Don't kill cronjobs if something goes wrong. await log_channel.send( - "Cron-daily has errored: ```" f"{traceback.format_exc()}```" + f"Cron-daily has errored: ```{traceback.format_exc()}```" ) await asyncio.sleep(86400) # Your stuff that should run a day after boot