Discord.py 机器人不会发送gif

Discord.py 机器人不会发送gif,discord.py,Discord.py,所以我想从一个文件夹发送一个随机的gif,它不工作的代码是 `@client.command() @commands.cooldown(1, 5, commands.BucketType.user) async def spank(self, ctx, *, member: discord.Member): member1 = ctx.message.author dir = "gif\spank" gif = random.choice(os.listdir(dir)) w

所以我想从一个文件夹发送一个随机的gif,它不工作的代码是

`@client.command()
@commands.cooldown(1, 5, commands.BucketType.user)
async def spank(self, ctx, *, member: discord.Member):
member1 = ctx.message.author
dir = "gif\spank"
gif = random.choice(os.listdir(dir))
with open(f'{dir}\\{gif}', 'rb') as f:
    await ctx.send(file=File(f))`

欢迎来到StackOverflow,请告诉我们有关您的问题的更多详细信息,有关提问的更多信息,请参阅。