How do I make this only convert commands and not arguments or urls?
because if i do >play UrL
it converts the url to lower case >play url
. I want it only to convert the command and not the url/arguments e.g. >say Hi
: I don't want that to convert to >say hi
, I want to only convert the command: >SaY Hi
to >say Hi
.
code:
message.content = message.content.lower().replace(' ', '')
await client.process_commands(message)
the whole code
@client.event
async def on_message(message):
author = message.author
if message.author.nick is None:
author = message.author.display_name
content = message.content
channel = message.channel
print('{}: {}'.format(author, content))
print('Channel: {}'.format(channel))
print(' ')
message.content = message.content.lower().replace(' ', ' ')
await client.process_commands(message)
else:
author = message.author.nick
content = message.content
channel = message.channel
print('{}: {}'.format(author, content))
print('Channel: {}'.format(channel))
print(' ')
message.content = message.content.lower().replace(' ', ' ')
await client.process_commands(message)