GalaxyCogs/forums/forums.py
SeaswimmerTheFsh f02fd84888
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
feat(forums): added new forum_channel config option
2023-09-01 19:56:41 -04:00

25 lines
874 B
Python

import discord
from redbot.core import Config, checks, commands
class Forums(commands.Cog):
"""Custom cog intended for use on the Galaxy discord server.
Developed by SeaswimmerTheFsh."""
def __init__(self, bot):
self.bot = bot
self.config = Config.get_conf(self, identifier=2352711325)
self.config.register_guild(
request_roles = [],
forum_channel = " "
)
@commands.command()
async def resolved(self, ctx: commands.Context):
"""Marks a thread as resolved."""
channel = ctx.channel
if isinstance(channel, discord.Thread) and channel.parent_id == await self.config.guild(ctx.guild.id).forum_channel():
await ctx.send("Are you sure you'd like to mark this thread as resolved?")
else:
await ctx.message.add_reaction("")
return