Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with Anarchy breaking stuff for DM messages #71

Merged
merged 1 commit into from Jun 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions anarchy/anarchy.py
Expand Up @@ -9,6 +9,8 @@

def anarcheck():
async def predicate(ctx):
if ctx.guild is None:
return False
if ctx.guild.id == 133049272517001216:
return True ## Let's make an exception for #testing ? :)
perm = ctx.me.guild_permissions
Expand All @@ -22,6 +24,8 @@ async def predicate(ctx):

def can_vote():
async def predicate(ctx):
if ctx.guild is None:
return False
ts_lastvote = await ctx.cog.config.member(ctx.author).last_vote()
if ts_lastvote is None:
now = datetime.datetime.now()
Expand Down Expand Up @@ -167,6 +171,8 @@ async def anarchy_profile(self, ctx, member : discord.Member = None):

@commands.Cog.listener(name="on_message")
async def on_message(self, message):
if message.guild is None:
return
if await self.config.channel(message.channel).ignored():
return
if message.author.bot:
Expand Down