summaryrefslogtreecommitdiff
path: root/cogs/Topic.py
diff options
context:
space:
mode:
authorlexicade <jasonnlelong@gmail.com>2023-01-27 21:06:30 +0000
committerlexicade <jasonnlelong@gmail.com>2023-01-27 21:06:30 +0000
commit52801b4de1d63cd01191acf7fcee137977140ec0 (patch)
tree08271a1f1e3e8060486b6651c67c9934867c648e /cogs/Topic.py
parent8df873808c86805624851356f5dea76ec621de23 (diff)
Project initHEADmain
Diffstat (limited to 'cogs/Topic.py')
-rw-r--r--cogs/Topic.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/cogs/Topic.py b/cogs/Topic.py
new file mode 100644
index 0000000..f99d767
--- /dev/null
+++ b/cogs/Topic.py
@@ -0,0 +1,28 @@
+from discord.ext import commands
+import discord
+import importlib
+import utils
+importlib.reload(utils)
+
+
+class Topic(commands.Cog):
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command(aliases=[], application_command_meta=commands.ApplicationCommandMeta(options=[]))
+ async def topic(self, ctx):
+ """Post the channel topic into chat."""
+ txt_topic = "None" if ctx.channel.topic is None else ctx.channel.topic
+ emb = await utils.embed(ctx,
+ f"Topic for {ctx.channel.name}:",
+ f"{txt_topic}")
+ await ctx.send(embed=emb)
+
+def setup(bot):
+ print("INFO: Loading [Topic]... ", end="")
+ bot.add_cog(Topic(bot))
+ print("Done!")
+
+
+def teardown(bot):
+ print("INFO: Unloading [Topic]")