我好像也听不懂。加入语音频道不和.py

2024-09-30 18:32:01 发布

您现在位置:Python中文网/ 问答频道 /正文

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')

我不知道为什么它不起作用,请帮忙,我已经看了一些东西,但似乎什么也不管用。我什么都搜过了 谢谢你


Tags: importclientidgetasyncdefchannelrandom
1条回答
网友
1楼 · 发布于 2024-09-30 18:32:01
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从命令行安装它

相关问题 更多 >