Mohd osama
Mohd osama

Reputation: 81

How to insert multiple arguments into the discord bot command python

I'm trying to make my discord bot to execute a file and afterward send a message that the file has been executed but when I add the ctx.send command it does not send in the server. It does execute the bat file but the bot does not send a message saying "Opening Discord"

async def discord(self, ctx):
  await os.system("discord.bat") 
  await ctx.send('Opening discord')

Upvotes: 0

Views: 294

Answers (1)

Just for fun
Just for fun

Reputation: 4225

The problem is you don't have to await os.system as it's not a coroutine.

Below is the revised code:

async def discord(self, ctx):
    os.system("discord.bat") 
    await ctx.send('Opening discord')

Upvotes: 0

Related Questions