From c9018e1aebbec8957e0679d23bba40aae4770234 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Wed, 6 Mar 2024 04:28:19 -0500 Subject: markov: check enabled/opted-in status in generate --- markov/markov.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'markov') diff --git a/markov/markov.py b/markov/markov.py index 5b48bc6..9a2884f 100644 --- a/markov/markov.py +++ b/markov/markov.py @@ -196,6 +196,14 @@ class Markov(commands.Cog): @markov.command() async def generate(self, ctx, member: discord.Member | None): + if not await self.config.guild(ctx.guild).use_messages(): + await ctx.reply("Not enabled in this guild.") + return + if member is not None: + if not await self.config.member(member).use_messages(): + await ctx.reply("That member has opted out of markov generation.") + return + # NOTE: if changing PUNCTUATION, also change the regex in process_message() with the corresponding note PUNCTUATION = ".,!?/" if member is None: -- cgit v1.2.3-57-g22cb