WebJul 16, 2024 · const Discord = require ('discord.js'); const client = new Discord.Client (); const announcementChannel = client.channels.cache.get (process.env.CHANNELANN); let announcement = "MESSAGE HERE"; client.on ("presenceUpdate", (oldPresence, newPresence) => { if (!newPresence.activities) return false; … WebFeb 13, 2024 · You can see in the discord.js#message docs whats available to you So you could easily check either the ID of the channel via if (message.channel.id), check the name via if (message.channel.name) or pretty much any other available property and handle it to your liking. As an example for the test channel. if (message.channel.name === 'test') …
Introduction to Build a Book Club Bot with Discord.js
WebOct 28, 2024 · Send message to specific discord channel in discord.js v12. 2. Discord.js Send a message to a specific channel. 1. discord.py wait_for('reaction_add') functioning differently with direct messages. 0. discord.js send message on specific channel. 0. Forward console to channel discord.js. WebJan 22, 2024 · 143 1 3 13. I am not quite sure whether this is what you are asking, but to find a specific guild: message.guilds.cache.find (guild => guild.id === ''); And to find the channel id in the guild: client.channels.get ('') If this was not what you were asking please explain further. – Joe Moore. huayna picchu peru hike
Javascript Discord Js Sending Message To Specific Channel Stack
WebI want to send a greeting message to an "welcome" text channel, whenever a new user joins the server (guild). The problem I'm facing is that, when I find the wanted channel, I will receive the channel with the type GuildChannel.. Since GuildChannel has no send() function, I'm not able to send the message. But I can't find a way to find the … WebFeb 6, 2024 · channel ID has only numeretic format, so you need use let welcomeChannel = message.guild.channels.get ('637301291068031001') if (welcomeChannel) welcomeChannel (`Welcome to the server, $ {gdata.user.username}!`) Or if you want to attachImage you can use WebAug 18, 2024 · Discord.js sending a message to a specific channel – cherryblossom Aug 19, 2024 at 11:34 Add a comment 1 Answer Sorted by: 0 This is pretty simple actually. There are a few things you need to do. Separate the arguments Find channel with first argument (id) Send message to the channel with content of other arguments joined with … huayra codalunga engine