因此,我有一些代码可以创建一个临时通道,我想要它,因此当它打开时,我可以将嵌入发送到临时通道。这是当前的脚本:
bot.on('message', msg =>{
if(msg.content === (`${prefix}tempchannel`)) {
var server = msg.guild;
var name = msg.author.username;
server.channels.create(`${name} temp channel.`, { reason: `Temp channel for ${name}` })
msg.channel.send('Created a temp channel for you! Check your unreads.')
}})```
Could someone help me please?
答案 0 :(得分:0)
GuildChannelManager.create()
返回所创建频道的承诺。
server.channels
.create(`${name}-temp-channel`, { reason: `Temp channel for ${name}` })
.then((channel) => channel.send("This is a new channel")); // channel callback