【发布时间】:2022-01-08 20:55:45
【问题描述】:
我的 discord bot 的模块中有此代码以加入 vc:
import discord
import ffmpeg
from discord.ext import commands
client = commands.Bot(command_prefix = "!")
async def join(cxt):
vc = ctx.message.author.voice_channel
await client.join_voice_channel(channel)
但是主代码没有运行它,每当我尝试我的 !join 命令时它都不起作用。该机器人仍然在线,只是不会进入语音频道。该模块是命令。请帮忙!!
主要代码:
import discord
import os
import requests
import json
import random
import youtube_dl
import commands
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
message.content = message.content.lower()
if message.author == client.user:
return
client.run(os.getenv('TOKEN'))
【问题讨论】:
标签: python discord discord.py bots