diff options
author | Arjun Satarkar <me@arjunsatarkar.net> | 2024-03-06 09:28:19 +0000 |
---|---|---|
committer | Arjun Satarkar <me@arjunsatarkar.net> | 2024-03-06 09:28:19 +0000 |
commit | c9018e1aebbec8957e0679d23bba40aae4770234 (patch) | |
tree | aa3862c7143a842d872acc879ad9b9c1d91ad793 /markov/markov.py | |
parent | 9c81dbfc88ac21b107ac1402a8777612efa127b0 (diff) | |
download | aps-cogs-c9018e1aebbec8957e0679d23bba40aae4770234.tar aps-cogs-c9018e1aebbec8957e0679d23bba40aae4770234.tar.gz aps-cogs-c9018e1aebbec8957e0679d23bba40aae4770234.zip |
markov: check enabled/opted-in status in generate
Diffstat (limited to 'markov/markov.py')
-rw-r--r-- | markov/markov.py | 8 |
1 files changed, 8 insertions, 0 deletions
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: |