Python 3.x 如何使python discord bot发送实时GIF
我试图让我的基本discord机器人使用python显示GIF,就像用户从tenor发送一样。Python 3.x 如何使python discord bot发送实时GIF,python-3.x,discord,bots,gif,repl.it,Python 3.x,Discord,Bots,Gif,Repl.it,我试图让我的基本discord机器人使用python显示GIF,就像用户从tenor发送一样。 即: 我设法让我的机器人发送一个可以打开和查看的gif文件,但我想更进一步,让它在聊天中显示gif。 import discord import io import aiohttp client = discord.Client() @client.event async def on_ready(): print('We have logged in as {0.user}'.format(
即:
我设法让我的机器人发送一个可以打开和查看的gif文件,但我想更进一步,让它在聊天中显示gif。
import discord
import io
import aiohttp
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):
if message.author == client.user:
return
if message.content == 'hello':
embed = discord.Embed(title="Title", description="Desc", color=0x00ff00) #creates embed
file = discord.File("toodamnbad.gif", filename="image.png")
embed.set_image(url="attachment://image.png")
await message.channel.send(file=file)
client.run('TOKEN')