回答編集履歴
1
インデント修正
answer
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
ファイル(=画像)を送信するには[discord.File](https://discordpy.readthedocs.io/ja/latest/api.html#discord.File)とfileパラメータを使います。
|
2
2
|
```python
|
3
3
|
if message.content == '〇〇':
|
4
|
-
|
4
|
+
file = discord.File("ファイルのパス.png", filename="discord上のファイル名.png")
|
5
|
-
|
5
|
+
await message.channel.send(file=file)
|
6
6
|
```
|
7
7
|
また、client.send_fileはasync版(古いバージョン。今はrewrite版)のメソッドです。注意してください。
|