client.guilds.get(GUILD_ID).channels.get(746324211768885318).setName("Проба");
TypeError: Cannot read property 'setName' of undefined
guild.channels.find(channel => CHANNEL_NAME === channel.name);
const guild = bot.guilds.cache.get("id_гильдии")
const channel = guild.channels.cache.find(channel => channel.id === "id_канала")
channel.setName("members")
Возможно ли отправить сообщение на ID канала в дискорд (без использования имени)?
client.channels.cache.get('id_канала').send('сообщение');
.send
также можно заменить на любой другой метод. ГДЕ ВЫ ЭТО НАШЛИ?
Этот дурацкий док у API дискорда
const guild = client.guilds.get(GUILD_ID);
const channel = guild.channels.find(channel => CHANNEL_NAME === channel.name);
channel.setName("РАБОТАЕТ");
const {TOKEN, LOG_LOCATION, GUILD_ID, CHANNEL_NAME} = require('./configOnline.json');
var client = new Discord.Client();
client.on('ready', () => {
const guild = client.guilds.cache.get(GUILD_ID);
const channel = guild.channels.cache.find(channel => channel.id === 746324211768885318);
channel.setName("TEST");
});
client.login(TOKEN);
const {TOKEN, LOG_LOCATION, GUILD_ID, CHANNEL_NAME} = require('./configOnline.json');
var client = new Discord.Client();
client.on('ready', () => {
const guild = client.guilds.get(GUILD_ID);
const channel = guild.channels.find(channel => CHANNEL_NAME === channel.name);
channel.setName(CHANNEL_NAME + " Мои данные");
});
client.login(TOKEN);
const guild = bot.guilds.cache.get("id_гильдии")
const channel = guild.channels.cache.find(channel => channel.id === "id_канала")
channel.setName("members")