标题说得很清楚,我该如何将消息作者拖到机器人目前所在的语音通道中?
说我的机器人一个人在一个语音频道。调用命令只对作者播放声音。
但是作者不在语音通道中,所以我不能使用move_to(*)方法,因此单词拖放。
我在API引用中寻找连接,但似乎找不到任何连接。
Is it even possible to drag users into a voice channel?
@client.event
async def on_voice_state_update(member, before, after):
# This function is called when not only member join to the voice channel,
# but also member changed their status to mute.
# So, it is necessary to catch only events that joining channel.
if before.channel != after.
尝试让我的discord机器人将用户移动到消息作者所在的语音通道。例如,我写了!move @john,然后机器人就会把"john“移到我的语音频道。 # command to move a user to current channel
@bot.command()
async def move(ctx,member:discord.Member=None):
channel= discord.utils.get(ctx.guild.voice_channels)
if not member:
await ctx.send("Who am I
我正在使用Discord.Net并观察几个语音频道。如果这些语音通道具有由bot (而不是通过权限)设置的静音状态,则该语音通道中的用户也应保持静音状态。
从语音频道中删除语音权限不会立即影响人们,你可以在这里看到
如果他们离开了,他们就应该保持缄默。
所以这个人保存了所有所需的信息
public sealed class ObservedVoiceChannel
{
public ulong VoiceChannelId { get; set; }
public bool IsMuted { get; set; }
// ... other information
目前,我正在为我的不和谐服务器开发一个不和谐的(1.3.3)机器人。目前,我正试图让机器人在声音频道播放音乐。根据discord.py文档,您将使用函数连接到一个语音通道,该通道将返回一个对象。
但是,我从来没有从VoiceClient ()中得到一个channel.connect对象。这个机器人确实加入了我的通道,但是它似乎被困在一个无限的循环中。在执行“等待channel.connect()”行后,不会执行任何操作,因此不会打印行"test“。当我更新机器人在服务器中的角色时,它只运行一次,但在重新启动bot之后它将不再工作。
# This is just a function,
我想看看ctx.author是否连接到这个不和谐协会的任何语音频道。机器人可以做到这一点,但是对于每个ctx.author不在的通道,机器人发送的信息是“您需要连接到语音通道!”如何从成员列表创建一个列表,然后由机器人检查?
voice_channel_list = ctx.guild.voice_channels
for voice_channels in voice_channel_list:
if not ctx.author in voice_channels.members:
await ctx.send(embed=discord.Embed(color=d