【发布时间】:2020-11-03 09:47:14
【问题描述】:
我正在努力让我的机器人进入语音频道,我已经阅读了很多这里的帖子,但没有一个能够解决我的问题,我试图让我的机器人重现一个 yt 的声音视频,但它甚至没有加入,我不知道该怎么做,这是代码:
import os
import discord
import youtube_dl
from random import random, choice, randint
from dotenv import load_dotenv
from discord.ext import commands
load_dotenv()
token = os.getenv("DISCORD_TOKEN")
GUILD = os.getenv("DISCORD_GUILD")
bot = commands.Bot(command_prefix="!")
bot = commands.Bot(command_prefix="!")
@bot.command(name="join")
async def join(ctx):
author = ctx.message.author
channel = author.voice_channel
await bot.join_voice_channel(channel)
bot.run(token)
【问题讨论】:
标签: python python-3.x discord discord.py