Skip to content

Commit b156340

Browse files
committed
Template v2.4.2
* Blacklisted users are being ignored when executing a command
1 parent 53c4c52 commit b156340

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

UPDATES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Updates List
22
Here is the list of all the updates that I made on this template.
33

4+
### Version 2.4.2
5+
* Blacklisted users are being ignored when executing a command
6+
47
### Version 2.4.1
58
* Added config import to moderation cog
69

bot.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Description:
44
This is a template to create your own discord bot in python.
55
6-
Version: 2.4.1
6+
Version: 2.4.2
77
"""
88

99
import discord, asyncio, os, platform, sys
@@ -91,19 +91,10 @@ async def on_message(message):
9191
# Ignores if a command is being executed by a bot or by the bot itself
9292
if message.author == bot.user or message.author.bot:
9393
return
94-
else:
95-
if message.author.id not in config.BLACKLIST:
96-
# Process the command if the user is not blacklisted
97-
await bot.process_commands(message)
98-
else:
99-
# Send a message to let the user know he's blacklisted
100-
context = await bot.get_context(message)
101-
embed = discord.Embed(
102-
title="You're blacklisted!",
103-
description="Ask the owner to remove you from the list if you think it's not normal.",
104-
color=config.error
105-
)
106-
await context.send(embed=embed)
94+
# Ignores if a command is being executed by a blacklisted user
95+
if message.author.id in config.BLACKLIST:
96+
return
97+
await bot.process_commands(message)
10798

10899
# The code in this event is executed every time a command has been *successfully* executed
109100
@bot.event

0 commit comments

Comments
 (0)