Мне нужно прикрепить файл chat.log к сообщению, но появляется исключение
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\vlad0\AppData\Roaming\Python\Python36\site-packages\discord\client.py", line 227, in _run_event
await coro(*args, **kwargs)
File "c:\Users\vlad0\Desktop\bot\bot.py", line 660, in on_message
await channel.send('***Log for ticket #{id}***'.format(id = text),file = f )
File "C:\Users\vlad0\AppData\Roaming\Python\Python36\site-packages\discord\abc.py", line 752, in send
raise InvalidArgument('file parameter must be File')
discord.errors.InvalidArgument: file parameter must be File
Мой код:
with open(file[0]+'/chat.log','r', encoding='UTF-8') as f:
await channel.send('***Log for ticket #{id}***'.format(id = text),file = f.read() )
То же самое происходит, когда я читаю, используя "rb ", и то же самое, если вы просто указываете путь к файлу. Как мне прикрепить файл к сообщению?