Skip to content

Commit

Permalink
Update bot against discriminator changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Milkshak3s authored Jan 12, 2024
1 parent e3493de commit 7d8bd86
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,20 @@ async def on_message(message):
if message.author == discord_client.user:
return

message_author_unique = f"{message.author.name}#{message.author.discriminator}"
if message_author_unique not in admins:
print(f"[+] Message from: {message.author.name}")
if message.author.name not in admins:
print("[-] User not admin, skipping...")
return

print(f"{message.channel} - {message_author_unique} - {message.content}")
print(f"[i] {message.channel} - {message_author_unique} - {message.content}")
message_split = message.content.split(" ")
target_command = message_split[1]
command_func = commands.commands.get(target_command)

if command_func is not None:
if command_func is not None:
await command_func(message)
else:
print(f"[-] No command found for {target_command}")

discord_client.run(DISCORD_TOKEN)

Expand Down

0 comments on commit 7d8bd86

Please sign in to comment.