小编rop*_*pke的帖子

如何让我的 discord.py bot 在语音通道中播放 mp3?

我是 Python 的初学者,我最近开始为一些朋友和我制作一个不和谐的机器人。这个想法是输入 !startq 并让机器人加入频道,播放本地存储在同一文件夹中的 mp3 文件bot.py 也在。

import discord, chalk
from discord.ext import commands
import time
import asyncio

bot = commands.Bot(command_prefix = "!")

@bot.event
async def on_ready():
    print("Bot is ready!")

@bot.command()
async def q5(ctx):
    await ctx.send("@here QUEUE STARTING IN 5 MINUTES")

@bot.command()
async def q3(ctx):
    await ctx.send("@here QUEUE STARTING IN 3 MINUTES")

@bot.command()
async def q1(ctx):
    await ctx.send("@here QUEUE STARTING IN 1 MINUTES")

@bot.command()
async def ping(ctx):
    ping_ = bot.latency
    ping =  round(ping_ * 1000)
    await ctx.send(f"my ping is …
Run Code Online (Sandbox Code Playgroud)

ffmpeg python-3.x discord discord.py

5
推荐指数
1
解决办法
5万
查看次数

标签 统计

discord ×1

discord.py ×1

ffmpeg ×1

python-3.x ×1