【问题标题】:I Cant Seem to get it too join the voice channel discord.py我似乎也无法获得它加入语音频道 discord.py
【发布时间】:2017-08-11 00:59:45
【问题描述】:
import discord
import random

client = discord.Client()


async def joinVoiceChannel():


    channel = client.get_channel('Id')
    voice =  client.join_voice_channel(channel)
    print('Bot should joined the Channel')


 @client.event
    async def on_ready():
        #info
        print('Logged in as')
        print(client.user.name)
        print(client.user.id)
        print('------')
        await joinVoiceChannel()


client.run('token')

我不知道为什么它不起作用,请帮忙,我看过一些东西,但似乎没有任何效果。我已经搜索了一切 谢谢

【问题讨论】:

    标签: python discord


    【解决方案1】:
    import discord
    import random
    
    client = discord.Client()
    
    @Client.event
    async def on_ready():
        #info
        print('Logged in as')
        print(client.user.name)
        print(client.user.id)
        print('------')
    
        channel = Client.get_channel('id')
        await Client.join_voice_channel(channel)
        print('Bot should joined the Channel')
    
    client.run('token')
    

    还要确保你已经安装了 PyNaCl,可以通过复制粘贴py -m pip install PyNaCl从命令行安装它

    【讨论】:

      猜你喜欢
      • 2021-06-05
      • 2018-04-04
      • 2021-06-06
      • 2020-08-30
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多