Discordの特定の場所に画像を出力したいのですが、エラーが出てしまします。
宜しくお願いします。
python 3.6.6
windows 10
import discord
import asyncio
import random
import os
client = discord.Client()
[channel.id for channel in client.get_all_channels()]
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith("!画像"):
# 送り主がBotだった場合反応したくないので
if client.user != message.author:
path = r"C:\Users\〇〇" #ファイルパス dirs = os.listdir( path ) file = random.choice(dirs) image = image = path + "\" + file channel = client.get_channel=='00000000000'#チャンネルID await client.send_file(channel) ```python
コード
client.run("TOKEN") File "test.py", line 26, in on_message await client.send_file(channel) TypeError: send_file() missing 1 required positional argument: 'fp'