0

So im trying to code a discord bot that sends the name and id of every message in every channel to the Admin channel, but it says it cant read the property of send? Any Ideas?(Im more or less new to javascript,but i understand the basics of discord.js)

    bot.on('message',(message) =>{
bot.channels.get(459435599850504212).send(message.author.tag + ' ' + message.author.id)})

I know it would answer itself in a loop,but i just want to fix the send.

1 Answer 1

2

The channel id should be in quotes.

bot.channels.get('459435599850504212')

Seeing as ids for Discord.js aren't integers, if you are getting/finding data make sure you wrap it in quotes

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.