mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-06-02 10:34:54 +12:00
i need a script to automatically format for black
This commit is contained in:
parent
2244d01e20
commit
c6ca687c08
|
@ -7,8 +7,8 @@ import discord
|
||||||
|
|
||||||
BaseCog = getattr(commands, "Cog", object)
|
BaseCog = getattr(commands, "Cog", object)
|
||||||
|
|
||||||
class Confession(BaseCog):
|
|
||||||
|
|
||||||
|
class Confession(BaseCog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.config = Config.get_conf(self, identifier=665235)
|
self.config = Config.get_conf(self, identifier=665235)
|
||||||
default_guild = {"confession_room": ""}
|
default_guild = {"confession_room": ""}
|
||||||
|
@ -44,7 +44,15 @@ class Confession(BaseCog):
|
||||||
It'll ask you which guild to confess in if you have more than one with a confession
|
It'll ask you which guild to confess in if you have more than one with a confession
|
||||||
"""
|
"""
|
||||||
|
|
||||||
async def select_guild(ctx: commands.Context, pages: list, controls: dict, message: discord.Message, page: int, timeout: float, emoji: str):
|
async def select_guild(
|
||||||
|
ctx: commands.Context,
|
||||||
|
pages: list,
|
||||||
|
controls: dict,
|
||||||
|
message: discord.Message,
|
||||||
|
page: int,
|
||||||
|
timeout: float,
|
||||||
|
emoji: str,
|
||||||
|
):
|
||||||
# Clean up
|
# Clean up
|
||||||
with contextlib.suppress(discord.NotFound):
|
with contextlib.suppress(discord.NotFound):
|
||||||
await message.delete()
|
await message.delete()
|
||||||
|
@ -54,7 +62,7 @@ class Confession(BaseCog):
|
||||||
|
|
||||||
if bool(ctx.guild):
|
if bool(ctx.guild):
|
||||||
await ctx.send("You should do this in DMs!")
|
await ctx.send("You should do this in DMs!")
|
||||||
try :
|
try:
|
||||||
await ctx.message.delete()
|
await ctx.message.delete()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -112,7 +120,8 @@ class Confession(BaseCog):
|
||||||
|
|
||||||
await ctx.bot.send_filtered(destination=confession_room, embed=embed)
|
await ctx.bot.send_filtered(destination=confession_room, embed=embed)
|
||||||
except discord.errors.Forbidden:
|
except discord.errors.Forbidden:
|
||||||
return await ctx.author.send("I don't have permission to send messages to this room or something went wrong.")
|
return await ctx.author.send(
|
||||||
|
"I don't have permission to send messages to this room or something went wrong."
|
||||||
|
)
|
||||||
|
|
||||||
await ctx.author.send("Your confession has been sent, you are forgiven now.")
|
await ctx.author.send("Your confession has been sent, you are forgiven now.")
|
||||||
|
|
Loading…
Reference in a new issue