node.js - 如何创建临时频道加入不和谐频道?
问题描述
我正在制作一个不和谐的机器人来创建临时频道。你加入一个主频道,它会用你的名字创建一个频道,然后你就在里面切换。
我只需要知道如何移动加入主频道的用户可以在创建的频道中移动。
到目前为止我得到了这个:
export const joinToCreate: Function = async (oldState: any, newState: any): Promise<void> => {
if (newState.channel.id === "861987613598810122") {
const joinedUsername = newState.member.user.username;
const newChannel = await newState.guild.channels.create(`${joinedUsername}'s mix`, {
type: "voice",
parent: newState.channel.parent,
});
}
解决方案
你newChannel
所期待的承诺也是如此。现在,您可以使用VoiceState.setChannel()轻松地将成员移动到频道。这是您如何实现它的方法
//newChannel declaration
newState.setChannel(newChannel);
如果这不是你想要的,我很抱歉,但你的问题很不清楚
推荐阅读
- android - 如何为 AppAuth 库 android studio 创建重定向 url?
- clips - CLIPS编程中如何使用and运算符和or运算符
- python - 如何通过在其他字典中的字典中使用他的键来获取python字典值
- android - 如何从应用程序请求用户是否允许访问地理位置的信息
- r - 产品之间的偏好发现特定词之间的集群
- mysql - 它是 SQL 中的零字符通配符还是一个字符通配符?
- pandas - 使用 pandas 和 parquet 文件按州和日期分组,按月份分组日期
- linux - shell 脚本的 ccyymmddhhmmss 格式
- python - 远大的期望需要很长时间
- mongodb - 如何将 Mongo Atlas 集群配置为只能从 AWS ECS 访问?