@bot.command()
async def send(ctx):
message199 = 'Рассылкаn/a'
with open("txt.txt", "w", "utf-16") as file:
message = file.read()
message = str(message)
file.close()
for member in ctx.guild.members:
if not member.bot:
await member.send(message) # тут если передложение
Ошибка
Traceback (most recent call last):
File "C:\Users\Msi_Pc\PycharmProjects\PythonGame\venv\lib\site-packages\discord\ext\commands\core.py", line 229, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Msi_Pc\PycharmProjects\PythonGame\main.py", line 13, in send
with open("txt.txt", "w", "utf-16") as file:
TypeError: 'str' object cannot be interpreted as an integer
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Msi_Pc\PycharmProjects\PythonGame\venv\lib\site-packages\discord\ext\commands\bot.py", line 1349, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Msi_Pc\PycharmProjects\PythonGame\venv\lib\site-packages\discord\ext\commands\core.py", line 1023, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "C:\Users\Msi_Pc\PycharmProjects\PythonGame\venv\lib\site-packages\discord\ext\commands\core.py", line 238, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'str' object cannot be interpreted as an integer