forked from kemonomimi/nyabot
main: Fix bug preventing users from mentioning other users in commands
This commit is contained in:
parent
c78f2bc4a7
commit
fa010d901c
1 changed files with 6 additions and 3 deletions
7
main.py
7
main.py
|
@ -249,10 +249,11 @@ async def help(ctx: discord.ApplicationContext):
|
|||
|
||||
|
||||
async def gif_command_handler(message: discord.Message, command: list[str]):
|
||||
command_typed = command[1]
|
||||
command_typed = command[0]
|
||||
|
||||
target = message.author.name
|
||||
sender = message.author.name
|
||||
|
||||
if len(message.mentions) > 0:
|
||||
target = message.mentions[0].name
|
||||
|
||||
|
@ -297,8 +298,10 @@ async def on_message(message: discord.Message):
|
|||
|
||||
# TODO: Do proper parsing of the message
|
||||
message_as_command = message.content.split("nya ")
|
||||
message_as_command = message_as_command[1].split(" ")
|
||||
|
||||
command = message_as_command[0]
|
||||
|
||||
command = message_as_command[1]
|
||||
if command in GIF_COMMANDS:
|
||||
await gif_command_handler(message, message_as_command)
|
||||
|
||||
|
|
Loading…
Reference in a new issue