如何从Youtube向discord机器人python发送视频
我正在使用python discord bot。我需要从Youtube发送视频。我只有这个视频的url。请帮帮我。假设不存在8mb的文件不一致限制。然后你想先下载youtube视频,然后通过discord频道发送。你需要皮管如何从Youtube向discord机器人python发送视频,python,video,discord,bots,discord.py,Python,Video,Discord,Bots,Discord.py,我正在使用python discord bot。我需要从Youtube发送视频。我只有这个视频的url。请帮帮我。假设不存在8mb的文件不一致限制。然后你想先下载youtube视频,然后通过discord频道发送。你需要皮管 pip install pytube 在discord.py文件中: @bot.command(pass_context=True) async def send(ctx): area=ctx.message.channel await bot.send_
pip install pytube
在discord.py文件中:
@bot.command(pass_context=True)
async def send(ctx):
area=ctx.message.channel
await bot.send_file(area, r"c:\location\of\the_file_to\send.png",filename="Trial",content="Message test")
你能再详细一点吗?我的理解是,用户输入URL,你想让机器人发送视频?是的,你说得对。这样做的一个问题是不一致将文件限制为8mb。不过,我会留下一个答案,假设机器人不遵守限制,这个答案会有效。谢谢。但我能不存钱就做吗?遗憾的是,不行(我想不出其他办法)。无论如何,如果这有助于你验证我的答案吗?谢谢。
@bot.command(pass_context=True)
async def send(ctx):
area=ctx.message.channel
await bot.send_file(area, r"c:\location\of\the_file_to\send.png",filename="Trial",content="Message test")