bot on ready event send message
See original GitHub issueHey guys! I’m currently writing a small git bot, and yeah.
I’m trying to send a message on ready event. That’s my current code:
bot.on('ready', () => { console.log('ready!'); bot.sendMessage('general', 'test'); });
yeah… I don’t receive a message. What I did wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to a send message in a channel when the bot is ready?
fetch and this function returns a promise that resolves to a channel. Here is your new ready event. client.on('ready', () => { client....
Read more >Events & The Documentation · A Guide to Discord Bots - Maah
The full list can be seen here, under the "Events" category. We can see the "ready" and "message" events that we used earlier....
Read more >Event handling - discord.js Guide
Client#event:ready open in new window emits once when the Client becomes ready for use, and Client#event:interactionCreate open in new window ...
Read more >Quickstart - Discord.py - Read the Docs
In our case, the on_ready() event is called when the bot has finished logging in and setting things up and the on_message() event...
Read more >How to Make a Discord Bot: An Overview and Tutorial - Toptal
log('Connected and ready.'); }); // Every time a message is sent anywhere the bot is present, // this event will fire and we...
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
@GlitchMasta47 Hey dude, not sure if you’re still trying to accomplish this, but I was searching for a way to do it too.
You need to call sendmessage() on a channel object rather than the client.
bot.sendMessage()
only takes a resolvable so either put a channel object or an actual id in it