0
votes

I'm setting up a new discord bot using the @bot.command() functionality, however, my !say command will not take the user's input and then have the bot say it

@bot.command()
async def say(message):
  #await bot.delete_message(message)
  await bot.send_message(message.channel, message)

This is for a discord server and the bot is to auto admin things for me aswell as provide the discord members functions to use. I've tried:

  • bot.say(message)
  • bot.say(message.channel, message)
  • bot.send_message(messsage)
  • bot.send_message(message.channel, messsage)

The expected result is for the bot to "say" the user's message e.g. with !say Hello the bot would reply with "Hello"

1

1 Answers

0
votes

You have to use channel.send() for example:

@bot.command()
async def foo(ctx, arg):
    await ctx.send(arg)

You can see more explained Examples at: https://discordpy.readthedocs.io/en/rewrite/ext/commands/commands.html