message.channel.send not working discord.js

Lunesdale Music

Sorry if I am being completely stupid, I am new and have no experience in JS

For some reason, when I do message.channel.send('Whatever') is gives the error 'message is not defined'. Do I need to define it myself? I couldnt find anything on the documentation, I either haven't been looking hard enough I am being completely stupid. Help would be greatly appreciated

Axiumin_

Message is not defined as when you do message.channel.send();, you are taking a variable called message which is most likely a message sent and finding out its channel to send a message in that specific channel. What it is saying is "Oh, you never told me what the variable 'message' meant. Mind to explain?" To fix it, define it in the function <name of the Discord.Client variable>.on('message', async message => {});

TLDR: Define the variable with <name of the Discord.Client variable>.on('message', async message => {});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I send a message to a specific channel in discord.js?

From Dev

Check if a user can send message in a specific channel discord.js

From Dev

discord channel link in message

From Dev

discord channel link in message

From Dev

How to send message with discord.js with ID

From Dev

Discord.JS Send message to tagged user

From Dev

Send a message if there is a role Discord.js

From Dev

Discord.js -- make presenceUpdate send a message

From Dev

Get last message from text channel with discord.js

From Dev

how can i make my discord.py bot send a message i choose to a channel i choose?

From Dev

How do I use discord.py to send a greeting message in the System Messages Channel

From Dev

Discord.py bot.send_message() does not go to the channel it has been called at

From Dev

How to make discord bot wait for reply for 5 minutes and then send a message? Using discord js

From Java

message.channel.id Discord PY

From Dev

Send a message in a channel "only visible to you"

From Dev

Cannot send message to just created channel

From Dev

Send a message to a YouTube Channel via API

From Dev

Spring integration : Not able to send the message to channel

From Dev

Unable to send a message to specific channel in Slack with Hubot - SlackRTMError: no channel id

From Dev

Unable to send a message to specific channel in Slack with Hubot - SlackRTMError: no channel id

From Dev

Sending Message to Discord Channel without message from user

From Dev

Discord Bot shall delete "user pinned message to channel" message

From Dev

Discord.js bot error, console: DiscordAPIError: Cannot send an empty message

From Dev

How do I send a message without using the deprecated way "sendMessage" in discord.js?

From Dev

Swift Code to Send Message Not Working

From Dev

discord.js not sending to custom channel

From Dev

Discord.js Voice Channel with Slash Commands

From Dev

discord.js voice channel member count

From Dev

Discord js / Check if user is in an specific voice Channel

Related Related

  1. 1

    How do I send a message to a specific channel in discord.js?

  2. 2

    Check if a user can send message in a specific channel discord.js

  3. 3

    discord channel link in message

  4. 4

    discord channel link in message

  5. 5

    How to send message with discord.js with ID

  6. 6

    Discord.JS Send message to tagged user

  7. 7

    Send a message if there is a role Discord.js

  8. 8

    Discord.js -- make presenceUpdate send a message

  9. 9

    Get last message from text channel with discord.js

  10. 10

    how can i make my discord.py bot send a message i choose to a channel i choose?

  11. 11

    How do I use discord.py to send a greeting message in the System Messages Channel

  12. 12

    Discord.py bot.send_message() does not go to the channel it has been called at

  13. 13

    How to make discord bot wait for reply for 5 minutes and then send a message? Using discord js

  14. 14

    message.channel.id Discord PY

  15. 15

    Send a message in a channel "only visible to you"

  16. 16

    Cannot send message to just created channel

  17. 17

    Send a message to a YouTube Channel via API

  18. 18

    Spring integration : Not able to send the message to channel

  19. 19

    Unable to send a message to specific channel in Slack with Hubot - SlackRTMError: no channel id

  20. 20

    Unable to send a message to specific channel in Slack with Hubot - SlackRTMError: no channel id

  21. 21

    Sending Message to Discord Channel without message from user

  22. 22

    Discord Bot shall delete "user pinned message to channel" message

  23. 23

    Discord.js bot error, console: DiscordAPIError: Cannot send an empty message

  24. 24

    How do I send a message without using the deprecated way "sendMessage" in discord.js?

  25. 25

    Swift Code to Send Message Not Working

  26. 26

    discord.js not sending to custom channel

  27. 27

    Discord.js Voice Channel with Slash Commands

  28. 28

    discord.js voice channel member count

  29. 29

    Discord js / Check if user is in an specific voice Channel

HotTag

Archive