feat: cog info

main
winston 2022-11-28 04:51:51 +01:00
parent 700a3d60e1
commit 954f9252c1
No known key found for this signature in database
GPG Key ID: 3786770EDBC2B481
3 changed files with 30 additions and 5 deletions

@ -7,11 +7,13 @@ class AutoThreader(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.config = Config.get_conf(self, identifier=8957967497)
self.config = Config.get_conf(
self, identifier=8957967497, force_registration=True
)
self.config.register_guild(autothread_channels=[])
@commands.Cog.listener()
async def on_message(self, msg: Message):
async def on_message(self, msg: Message) -> None:
"""Create a thread for each message in a channel."""
guild = msg.guild
@ -27,12 +29,12 @@ class AutoThreader(commands.Cog):
@commands.guild_only()
@commands.admin_or_permissions(manage_channels=True)
@commands.command(name="autothread")
async def autothread(self, ctx: commands.Context, channel: TextChannel):
async def autothread(self, ctx: commands.Context, channel: TextChannel) -> None:
"""Setup a channel for autothreading."""
guild = ctx.guild
if guild is None:
return await ctx.send("This command can only be used in a server.")
return
watched_channels = await self.config.guild(guild).autothread_channels()
@ -45,7 +47,7 @@ class AutoThreader(commands.Cog):
await self.config.guild(guild).autothread_channels.set(watched_channels)
async def create_thread(self, msg: Message):
async def create_thread(self, msg: Message) -> None:
"""Setup a channel for autothreading."""
channel = msg.channel
thread_title = (

@ -0,0 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/Cog-Creators/Red-DiscordBot/V3/develop/schema/red_cog.schema.json",
"name": "autothreader",
"short": "Automatically create threads for new messages in a channel.",
"description": "Automatically create threads for new messages in a channel.",
"end_user_data_statement": "",
"author": ["nekowinston (winston#0001)"],
"required_cogs": {},
"requirements": [],
"tags": [],
"min_bot_version": "3.5.0",
"hidden": false,
"disabled": false,
"type": "COG"
}

@ -0,0 +1,8 @@
{
"$schema": "https://raw.githubusercontent.com/Cog-Creators/Red-DiscordBot/V3/develop/schema/red_cog_repo.schema.json",
"name": "catppuccin-cogs",
"author": ["nekowinston (winston#0001)"],
"short": "Cogs for the Catppuccin Discord bot.",
"description": "Cogs for the Catppuccin Discord bot.",
"install_msg": "Thank you for installing my repo!"
}