bot.say Issues
See original GitHub issueHello, I’m trying to experiment with some sort of XP system with a bot, where members will gain an amount of XP at random for every message they send, and for testing purposes, I’m trying to get it to tell me the amount of XP that is generated. Here’s my code:
@bot.event
async def on_message(message):
xpGain = random.randint(0,3)
print(xpGain)
await bot.say(message.channel,xpGain)
I’ve tried adding await bot.process_commands(message)
to the end of my function which is the only possible remedy I found online, but regardless I still receive the same error message:
TypeError: send_message() takes from 2 to 3 positional arguments but 4 were given
I can’t quite understand it because from what I can see, I’m only giving 2 arguments, message.channel
and xpGain
, so any help would be greatly appreciated 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
'Bot' object has no attribute 'say' #2260 - Rapptz/discord.py
i just maked the @bot.command() async def ping(ctx): await bot.say('Pong!') but it's don't working...
Read more >Discord Bot Troubleshooting - Scryfall
Information about common issues with the Scryfall Discord bot. ... have not restricted the bot's ability to see messages and speak in the...
Read more >Troubleshoot bot configuration issues - Bot Service
A bot can generate different types of errors, such as not being able to respond, throwing errors, or working in one channel but...
Read more >Meta's AI Chatbot Repeats Election and Anti-Semitic ...
Meta acknowledges that its chatbot may say offensive things, as it's still an experiment under development. The bot's stated beliefs are also ...
Read more >What Are Spam Bots and Why They're an Issue in Elon Musk's ...
Bots can tweet at people, share tweets, follow and be followed by other people. And there are good bots and bad.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You cannot use Bot.say in events, instead use Client.send_message, also if you ran it, it would go on a loop, so you might want to fix that, if that’s not what you want.
See this. You shouldn’t be using
bot.say
outside of commands. Also, in future, these types of questions can be asked at the official Discord server: https://discord.gg/r3sSKJJ