Black formatting

pull/163/head
ASSASSIN0831 4 years ago committed by GitHub
parent bce07f069f
commit 69e2e5acb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,8 +55,8 @@ class InfoChannel(Cog):
"channels_channel": "Total Channels: {count}", "channels_channel": "Total Channels: {count}",
"online_channel": "Online: {count}", "online_channel": "Online: {count}",
"offline_channel": "Offline:{count}", "offline_channel": "Offline:{count}",
"role_channel": "{role}: {count}" "role_channel": "{role}: {count}",
} },
} }
self.config.register_guild(**default_guild) self.config.register_guild(**default_guild)
@ -113,7 +113,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@commands.group(aliases=['icset']) @commands.group(aliases=["icset"])
@checks.admin() @checks.admin()
async def infochannelset(self, ctx: commands.Context): async def infochannelset(self, ctx: commands.Context):
""" """
@ -242,7 +242,9 @@ class InfoChannel(Cog):
await ctx.send("InfoChannel for offline user count has been disabled.") await ctx.send("InfoChannel for offline user count has been disabled.")
@infochannelset.command(name="rolecount") @infochannelset.command(name="rolecount")
async def _infochannelset_rolecount(self, ctx: commands.Context, role: discord.Role, enabled: bool = None): async def _infochannelset_rolecount(
self, ctx: commands.Context, role: discord.Role, enabled: bool = None
):
""" """
Toggle an infochannel that shows the amount of users in the server with the specified role Toggle an infochannel that shows the amount of users in the server with the specified role
""" """
@ -261,7 +263,7 @@ class InfoChannel(Cog):
else: else:
await ctx.send(f"InfoChannel for {role.name} count has been disabled.") await ctx.send(f"InfoChannel for {role.name} count has been disabled.")
@infochannelset.group(name='name') @infochannelset.group(name="name")
async def channelname(self, ctx: commands.Context): async def channelname(self, ctx: commands.Context):
""" """
Change the name of the infochannels Change the name of the infochannels
@ -269,7 +271,7 @@ class InfoChannel(Cog):
if not ctx.invoked_subcommand: if not ctx.invoked_subcommand:
pass pass
@channelname.command(name='category') @channelname.command(name="category")
async def _channelname_Category(self, ctx: commands.Context, *, text): async def _channelname_Category(self, ctx: commands.Context, *, text):
""" """
Change the name of the infochannel's category. Change the name of the infochannel's category.
@ -282,7 +284,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='members') @channelname.command(name="members")
async def _channelname_Members(self, ctx: commands.Context, *, text=None): async def _channelname_Members(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the total members infochannel. Change the name of the total members infochannel.
@ -306,7 +308,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='humans') @channelname.command(name="humans")
async def _channelname_Humans(self, ctx: commands.Context, *, text=None): async def _channelname_Humans(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the human users infochannel. Change the name of the human users infochannel.
@ -330,7 +332,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='bots') @channelname.command(name="bots")
async def _channelname_Bots(self, ctx: commands.Context, *, text=None): async def _channelname_Bots(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the bots infochannel. Change the name of the bots infochannel.
@ -354,7 +356,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='roles') @channelname.command(name="roles")
async def _channelname_Roles(self, ctx: commands.Context, *, text=None): async def _channelname_Roles(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the roles infochannel. Change the name of the roles infochannel.
@ -380,7 +382,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='channels') @channelname.command(name="channels")
async def _channelname_Channels(self, ctx: commands.Context, *, text=None): async def _channelname_Channels(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the channels infochannel. Change the name of the channels infochannel.
@ -405,7 +407,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='online') @channelname.command(name="online")
async def _channelname_Online(self, ctx: commands.Context, *, text=None): async def _channelname_Online(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the online infochannel. Change the name of the online infochannel.
@ -429,7 +431,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='offline') @channelname.command(name="offline")
async def _channelname_Offline(self, ctx: commands.Context, *, text=None): async def _channelname_Offline(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the offline infochannel. Change the name of the offline infochannel.
@ -453,7 +455,7 @@ class InfoChannel(Cog):
if not await ctx.tick(): if not await ctx.tick():
await ctx.send("Done!") await ctx.send("Done!")
@channelname.command(name='role') @channelname.command(name="role")
async def _channelname_Role(self, ctx: commands.Context, *, text=None): async def _channelname_Role(self, ctx: commands.Context, *, text=None):
""" """
Change the name of the infochannel for specific roles. Change the name of the infochannel for specific roles.
@ -538,7 +540,6 @@ class InfoChannel(Cog):
) )
await self.config.guild(guild).humanchannel_id.set(humanchannel.id) await self.config.guild(guild).humanchannel_id.set(humanchannel.id)
# Remove the old bot channel first # Remove the old bot channel first
botchannel_id = await self.config.guild(guild).botchannel_id() botchannel_id = await self.config.guild(guild).botchannel_id()
if category_id is not None: if category_id is not None:
@ -552,7 +553,6 @@ class InfoChannel(Cog):
) )
await self.config.guild(guild).botchannel_id.set(botchannel.id) await self.config.guild(guild).botchannel_id.set(botchannel.id)
# Remove the old roles channel first # Remove the old roles channel first
roleschannel_id = await self.config.guild(guild).roleschannel_id() roleschannel_id = await self.config.guild(guild).roleschannel_id()
if category_id is not None: if category_id is not None:
@ -567,7 +567,6 @@ class InfoChannel(Cog):
) )
await self.config.guild(guild).roleschannel_id.set(roleschannel.id) await self.config.guild(guild).roleschannel_id.set(roleschannel.id)
# Remove the old channels channel first # Remove the old channels channel first
channels_channel_id = await self.config.guild(guild).channels_channel_id() channels_channel_id = await self.config.guild(guild).channels_channel_id()
if category_id is not None: if category_id is not None:
@ -775,7 +774,6 @@ class InfoChannel(Cog):
name = channel_names["role_channel"].format(count=role_num, role=role.name) name = channel_names["role_channel"].format(count=role_num, role=role.name)
await rolechannel.edit(reason="InfoChannel update", name=name) await rolechannel.edit(reason="InfoChannel update", name=name)
async def update_infochannel_with_cooldown(self, guild): async def update_infochannel_with_cooldown(self, guild):
"""My attempt at preventing rate limits, lets see how it goes""" """My attempt at preventing rate limits, lets see how it goes"""
if self._critical_section_wooah_: if self._critical_section_wooah_:

Loading…
Cancel
Save