WebExample: discord.js create channel // Create a new text channel guild.channels.create('new-general', { reason: 'Needed a cool new channel' }) .then(console.log) .cat WebApr 5, 2024 · Sorted by: 1 If you have the channel ID and message ID: await message.guild.channels.cache.get ('channel-id').messages.fetch ('message-id') (async functions only) If you just have the channel ID and want the last message that wasn't the command: (await message.guild.channels.cache.get ('channel-id').messages.fetch ( { …
DISCORD.JS How to get a specific channel ID by name?
WebDec 29, 2024 · I need it for getting first mention on channel, so if there is some easier way (than getting first message), you can also post it. discord discord.js Share Follow asked Dec 29, 2024 at 17:43 Martin Lukavec 35 1 6 Add a comment 1 Answer Sorted by: 1 You can get all messages with fetchMessages () and then loop over and check for mentions: WebApr 13, 2024 · So here are 2 options: create another channel in .then block const tempo1 = guild.channels.create ('Channel Tempo', { type: 'category' }).then (result => { console.log ('Here is channel id', result.id) //create another channel here }) or use async await constructions,e.g. rit thomas gosnell hall
Discord.JS: How to get first channel of a guild? - Stack Overflow
WebAug 26, 2024 · 2 interaction.guild.channels.create returns a Promise resolving to a GuildChannel object which has an id property. Add await before interaction.guild.channels.create and you should be able to access the ID using ticketchannel.id. Share Improve this answer Follow answered Aug 26, 2024 at 11:24 … WebApr 12, 2024 · That includes a cache property which has all the channels the bot can see in it [1]. Use the find () method on it and compare the name // remember channel names can only be lowercase and have no spaces const channel = guild.channels.cache.find (channel => channel.name === "channel-name"); console.log (channel.id) WebApr 24, 2024 · Which works fine for the first time after the Bot starts. But after the member was kicked for the first time the bot always tries to kick the member from the voice channel even when the member is not connected to a voice channel. How can I check if the member is connected to a voice channel even after the member got kicked for the first time? smith county judge getz