Помогите, не знаю почему возникает такая ошибка, раньше все хорошо работало.
Код:
@commands.command(name="a_activity", aliases=['activity'])
async def __activity(self, inter, member: disnake.Member=None, date: str = time.strftime('%d.%m.%y')):
guild = await db.request(f"SELECT * FROM guilds WHERE gid = {inter.guild.id}")
if not guild: return
if await get_admin(inter.author.id, inter.guild.id) < await get_command_lvl('a_activity', inter.guild.id): return await inter.send(f"```{config.TAG} Недостаточно прав для выполнения данной команды.```")
ft = dtime.fromtimestamp
member = member if member else inter.author
row = await db.request(f"SELECT * FROM activities WHERE mid = {member.id} AND gid = {inter.guild.id} AND dtime = '{date}'", 'fetchall')
if not row: return await inter.response.send_message(f"```{config.TAG} Пользователь \"{member}\" \n\nПроделанная работа\n\n — Данные за указанное число отсуствуют\n\nОнлайн пользователя в каналах\n — Данные за указанное число отсуствуют\n\nДата: {date}\nОбщий онлайн: 0ч 00м```", ephemeral=True)
print(1)
_data = [f"{n}. \"{inter.guild.get_channel(int(i['channel']))}\", онлайн: {tools.getTime(ft(i['end_time'] - i['start_time'] - 10800).strftime('%d:%H:%M:%S')) if i['end_time'] > 0 else tools.getTime(ft(time.time() - i['start_time'] - 10800).strftime('%d:%H:%M:%S'))}\n" for n, i in enumerate(row, 1)]
try:
messages = ''.join([f'{i}' async for _, i in Pages(1, _data, 1000)])
except PageNotFoundError: pass
onlines = sum([i['end_time'] - i['start_time'] if i['end_time'] else time.time() - i['start_time'] for i in row])
await inter.send(f"```{config.TAG} Пользователь \"{member}\"\n\nПроделанная работа\n-\n\nОнлайн пользователя в каналах\n{messages}\n\nДата: {timestampik(time.time())}\nОбщий онлайн: {tools.getTime(dtime.fromtimestamp(onlines - 10800).strftime('%d:%H:%M:%S'))}```")
Ошибка:
Ignoring exception in command a_activity:
Traceback (most recent call last):
File "C:\Users\magom\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 172, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\magom\Desktop\CrimenalDiscordBot\commands\a_activity.py", line 53, in __activity
_data = [f"{n}. \"{inter.guild.get_channel(int(i['channel']))}\", онлайн: {tools.getTime(ft(i['end_time'] - i['start_time'] - 10800).strftime('%d:%H:%M:%S')) if i['end_time'] > 0 else tools.getTime(ft(time.time() - i['start_time'] - 10800).strftime('%d:%H:%M:%S'))}\n" for n, i in enumerate(row, 1)]
File "C:\Users\magom\Desktop\CrimenalDiscordBot\commands\a_activity.py", line 53, in <listcomp>
_data = [f"{n}. \"{inter.guild.get_channel(int(i['channel']))}\", онлайн: {tools.getTime(ft(i['end_time'] - i['start_time'] - 10800).strftime('%d:%H:%M:%S')) if i['end_time'] > 0 else tools.getTime(ft(time.time() - i['start_time'] - 10800).strftime('%d:%H:%M:%S'))}\n" for n, i in enumerate(row, 1)]
OSError: [Errno 22] Invalid argument
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\magom\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\bot_base.py", line 578, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\magom\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 914, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\magom\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 181, in wrapped
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: OSError: [Errno 22] Invalid argument