diff --git a/cogs/events.py b/cogs/events.py index 7668d40..284acd8 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -109,6 +109,7 @@ class Events(commands.Cog): # Don't handle commands that have their own custom error handler if hasattr(ctx.command, 'on_error'): return + # Someone just mentioned Didier without calling a real command, # don't care about this error if isinstance(err, (commands.CommandNotFound, commands.CheckFailure, commands.TooManyArguments, commands.ExpectedClosingQuoteError), ): @@ -120,9 +121,11 @@ class Events(commands.Cog): await ctx.send("Geen message gevonden die overeenkomt met het opgegeven argument.") elif isinstance(err, (commands.ChannelNotFound, commands.ChannelNotReadable)): await ctx.send("Geen channel gevonden dat overeenkomt met het opgegeven argument.") + elif isinstance(err, commands.ThreadNotFound): + await ctx.reply("Thread niet gevonden.", mention_author=False) # Someone forgot an argument or passed an invalid argument elif isinstance(err, (commands.BadArgument, commands.MissingRequiredArgument, commands.UnexpectedQuoteError)): - await ctx.send("Controleer je argumenten.") + await ctx.reply("Controleer je argumenten.", mention_author=False) else: usage = stringFormatters.format_command_usage(ctx) await self.sendErrorEmbed(err, "Command", usage) diff --git a/cogs/other.py b/cogs/other.py index 859c55d..efddcab 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -1,3 +1,4 @@ +import discord from discord.ext import commands from data.embeds.snipe import EditSnipe, DeleteSnipe @@ -24,6 +25,16 @@ class Other(commands.Cog): """ await custom_commands.CommandsList(ctx).send() + @commands.command(name="Join", usage="[Thread]") + @help.Category(category=Category.Didier) + async def join_thread(self, ctx, thread: discord.Thread): + """ + Join threads + """ + if thread.me is None: + await thread.join() + await ctx.message.add_reaction("✅") + @commands.command(name="Snipe") @help.Category(category=Category.Other) async def snipe(self, ctx): diff --git a/files/help.json b/files/help.json index f14e6f1..c15ecb7 100644 --- a/files/help.json +++ b/files/help.json @@ -55,6 +55,7 @@ "inspire": "Genereer quotes via [InspiroBot](https://inspirobot.me/).", "inventory": "Bekijk de items in jouw inventory.", "invest": "Investeer [Aantal] Didier Dinks in jouw Didier Bank om rente te vergaren.", + "join": "Laat Didier [Thread] joinen.", "jpl": "Informatie over de Jupiler Pro League.", "jpl matches": "Bekijk de wedstrijden die gespeeld worden op [Week]. Default naar de huidige speeldag.", "jpl table": "De huidige stand van het klassement.",