dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
683 stars 162 forks source link

Interactions without nonces crash the library #311

Closed Ne0shka closed 2 years ago

Ne0shka commented 2 years ago

Summary

KeyError: 'nonce'

Reproduction Steps

1) Launch code 2) Enter "-update" 3) Get traceback

Code

from asyncio import sleep
from emoji import emojize
from datetime import datetime
from discord.ext import tasks
from discord import Client, Interaction
from discord.utils import find, remove_markdown

from config import TOKEN, CHANNEL_ID

class App(Client):

    async def setup_hook(self) -> None:
        self.auto_update_task.start()

    async def on_ready(self):
        print(f"Logged in as {self.user} (ID: {self.user.id})")
        print("------")

    async def get_message_with_interaction(self, itn):
        await sleep(3)
        return find(lambda m: m.interaction and m.interaction.id == itn.id,
                    self.cached_messages)

    async def get_stats(self):
        clan = []
        ch = self.get_channel(CHANNEL_ID)
        async for cmd in ch.slash_commands("clan members"):
            for subcmd in cmd.children:
                if subcmd.name == "members":
                    itn = await subcmd()
                    msg = await self.get_message_with_interaction(itn) if type(itn) == Interaction else None
                    if msg:
                        if not msg.embeds:
                            return None
                        embed = msg.embeds[0]
                        stats = remove_markdown(embed.description).split("\n")
                        if msg.components:
                            stats = stats[2:]
                            clicks = int(embed.footer.text.split("/")[1]) - 1
                            button = msg.components[0].children[2]
                            for i in range(clicks):
                                await button.click()
                                await sleep(3)
                                embed = msg.embeds[0]
                                stats.extend(remove_markdown(embed.description).split("\n")[2:])
                        await msg.delete()
                        for s in stats:
                            s = s.split("  ")[1]
                            s = s.split(" — ")
                            h = s[1].split(" ")
                            h = [h[0], h[2], h[4]]
                            for i, h in enumerate(h):
                                if len(h[i]) == 1:
                                    h[i] = f"0{h[i]}"
                            member = await ch.guild.fetch_member(int(s[0]))
                            clan.append([f"{member.name}#{member.discriminator}", s[0], h, s[2],
                                         datetime.fromtimestamp(int(s[3].split(":")[1])).strftime("%d %b %Y")])
                    return msg

    @tasks.loop(hours=8)
    async def auto_update_task(self):
        await self.get_stats()

    @auto_update_task.before_loop
    async def before_tasks(self):
        await self.wait_until_ready()

    async def on_message(self, msg):
        if self.is_ready() and msg.channel.id == CHANNEL_ID and type(msg.content) == str:
            if msg.content == "-ping":
                await msg.add_reaction(emojize(":check_mark_button:"))
            if msg.content == "-update":
                await msg.channel.trigger_typing()
                if await self.get_stats():
                    await msg.add_reaction(emojize(":check_mark_button:"))

App().run(TOKEN)

Expected Results

The code works.

Actual Results

Traceback (most recent call last): File "/home/neoshka/Рабочий стол/clanbot/main.py", line 102, in App().run(TOKEN) File "/home/neoshka/venvs/discord_self_bot/lib/python3.8/site-packages/discord/client.py", line 727, in run asyncio.run(runner()) File "/home/neoshka/.pyenv/versions/3.8.12/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/home/neoshka/.pyenv/versions/3.8.12/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/neoshka/venvs/discord_self_bot/lib/python3.8/site-packages/discord/client.py", line 724, in runner await self.start(*args, **kwargs) File "/home/neoshka/venvs/discord_self_bot/lib/python3.8/site-packages/discord/client.py", line 698, in start await self.connect(reconnect=reconnect) File "/home/neoshka/venvs/discord_self_bot/lib/python3.8/site-packages/discord/client.py", line 605, in connect await self.ws.poll_event() File "/home/neoshka/venvs/discord_self_bot/lib/python3.8/site-packages/discord/gateway.py", line 609, in poll_event await self.received_message(msg.data) File "/home/neoshka/venvs/discord_self_bot/lib/python3.8/site-packages/discord/gateway.py", line 559, in received_message func(data) File "/home/neoshka/venvs/discord_self_bot/lib/python3.8/site-packages/discord/state.py", line 2212, in parse_interaction_create type, name, channel = self._interaction_cache.pop(data['nonce'], (0, None, None)) KeyError: 'nonce'

Process finished with exit code 1

System Information

Checklist

Additional Information

The problem is floating, because the same code worked an hour earlier.

dolfies commented 2 years ago

Interactions should never not have a nonce to my knowledge. Next time the issue occurs, pleasr provide logs (set log level to debug) so I can figure out what's going wrong.

Ne0shka commented 2 years ago
2022-07-03 17:21:41,428:DEBUG:discord.gateway: Gateway event: {'t': 'MESSAGE_CREATE', 's': 293535, 'op': 0, 'd': {'type': 0, 'tts': False, 'timestamp': '2022-07-03T14:21:41.305000+00:00', 'referenced_message': None, 'pinned': False, 'nonce': '993159600645603328', 'mentions': [], 'mention_roles': [], 'mention_everyone': False, 'member': {'roles': ['587229627102134273', '765698031861366813', '587946112204406804', '585532058022182933', '774068798620696598', '880837511792975893', '990302936544444437', '963239433400881272', '774059943870726205'], 'premium_since': '2022-06-13T16:13:47.935000+00:00', 'pending': False, 'nick': 'Неошка 🌙', 'mute': False, 'joined_at': '2021-12-07T10:45:30.190000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'avatar': 'a_8f4d08d1c06d54c29da604795de65a52'}, 'id': '993159602734628884', 'flags': 0, 'embeds': [], 'edited_timestamp': None, 'content': '-update', 'components': [], 'channel_id': '837035398328614942', 'author': {'username': 'Неошка', 'public_flags': 64, 'id': '247690540840124416', 'discriminator': '7777', 'avatar_decoration': None, 'avatar': 'a_600799265c7269c00403a8675412c4bf'}, 'attachments': [], 'guild_id': '457902248660434944'}}.
2022-07-03 17:21:41,428:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:41,428:DEBUG:discord.gateway: Parsing event MESSAGE_CREATE.
2022-07-03 17:21:41,428:DEBUG:discord.client: Dispatching event message.
2022-07-03 17:21:41,464:DEBUG:discord.gateway: Gateway event: {'t': 'PRESENCE_UPDATE', 's': 293536, 'op': 0, 'd': {'user': {'id': '280312836708761600'}, 'status': 'dnd', 'guild_id': '457902248660434944', 'client_status': {'desktop': 'dnd'}, 'activities': [{'type': 0, 'state': 'Бегает', 'session_id': '53489f5a8a663d2e97caad94f9640cb2', 'party': {'size': [166, 5000], 'id': '127.0.0.1:22005'}, 'name': 'RAGE Multiplayer', 'id': 'bcdb7c54c29fbed9', 'flags': 2, 'details': 'ONYX', 'created_at': 1656858100916, 'assets': {'large_text': 'In game', 'large_image': '638071662419640365'}, 'application_id': '378293683256164352'}, {'type': 0, 'timestamps': {'start': 1656857818332}, 'state': 'Connected', 'session_id': '53489f5a8a663d2e97caad94f9640cb2', 'name': 'FH | IN TESTING', 'id': '5de0558170cd494e', 'details': 'SAFE MODE', 'created_at': 1656857819653, 'buttons': ['RAGE MP', 'v0.1.4'], 'assets': {'small_text': '<server:rage2.onyx-gta.ru>', 'small_image': '993099869491318784', 'large_text': '<by flovers>', 'large_image': '993098692343103638'}, 'application_id': '993096417990156369'}]}}.
2022-07-03 17:21:41,465:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:41,465:DEBUG:discord.gateway: Parsing event PRESENCE_UPDATE.
2022-07-03 17:21:41,465:DEBUG:discord.state: PRESENCE_UPDATE referencing an unknown member ID: 280312836708761600. Discarding
2022-07-03 17:21:41,620:DEBUG:discord.gateway: Gateway event: {'t': 'TYPING_START', 's': 293537, 'op': 0, 'd': {'user_id': '247690540840124416', 'timestamp': 1656858101, 'member': {'user': {'username': 'Неошка', 'public_flags': 64, 'id': '247690540840124416', 'discriminator': '7777', 'bot': False, 'avatar': 'a_600799265c7269c00403a8675412c4bf'}, 'roles': ['587229627102134273', '765698031861366813', '587946112204406804', '585532058022182933', '774068798620696598', '880837511792975893', '990302936544444437', '963239433400881272', '774059943870726205'], 'premium_since': '2022-06-13T16:13:47.935000+00:00', 'pending': False, 'nick': 'Неошка 🌙', 'mute': False, 'joined_at': '2021-12-07T10:45:30.190000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'avatar': 'a_8f4d08d1c06d54c29da604795de65a52'}, 'channel_id': '837035398328614942', 'guild_id': '457902248660434944'}}.
2022-07-03 17:21:41,620:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:41,620:DEBUG:discord.gateway: Parsing event TYPING_START.
2022-07-03 17:21:41,620:DEBUG:discord.client: Dispatching event typing.
2022-07-03 17:21:41,621:DEBUG:discord.http: POST https://discord.com/api/v9/channels/837035398328614942/typing with None has returned 204.
2022-07-03 17:21:41,621:DEBUG:discord.http: POST https://discord.com/api/v9/channels/837035398328614942/typing has received 
2022-07-03 17:21:41,920:DEBUG:discord.http: GET https://discord.com/api/v9/channels/837035398328614942/application-commands/search with None has returned 200.
2022-07-03 17:21:41,921:DEBUG:discord.http: GET https://discord.com/api/v9/channels/837035398328614942/application-commands/search has received {'applications': [{'id': '819778342818414632', 'name': 'Activities', 'icon': '052f86876646cd1d83a2ca2be68d5e71', 'description': 'Bot for starting voice channel activities, made by advaith (use /activity)\nhttps://github.com/advaith1/activities\n\nActivity feedback: https://s.advaith.io/discordactivityfeedback\n', 'summary': '', 'type': None, 'bot': {'id': '819778342818414632', 'username': 'Activities', 'avatar': '37f3ef42675d1e91462ad139e7e7b723', 'avatar_decoration': None, 'discriminator': '3305', 'public_flags': 589824, 'bot': True}}, {'id': '970505177549381703', 'name': 'Consliger', 'icon': '4ed156db8fdb1a83f1da9c2cd16e388f', 'description': '', 'summary': '', 'type': None, 'bot': {'id': '970505177549381703', 'username': 'Consliger', 'avatar': '8d5ee9ffc97694f4a6e0f89b67da25cd', 'avatar_decoration': None, 'discriminator': '6594', 'public_flags': 0, 'bot': True}}, {'id': '184405253028970496', 'name': 'FredBoat♪♪', 'icon': 'b4b8890f5cd48579d54a294c7e308fdd', 'description': 'The best music bot on Discord. ♪ Toot Toot ♪\nWebsite: https://fredboat.com\nSupport: https://discord.gg/q9yMfFb\nPartner bots: https://botlabs.gg/bots', 'summary': '', 'type': None, 'bot': {'id': '184405311681986560', 'username': 'FredBoat♪♪', 'avatar': '7e25f540b31d70360e69fea14dbd865a', 'avatar_decoration': None, 'discriminator': '7284', 'public_flags': 65536, 'bot': True}}, {'id': '294882584201003009', 'name': 'GiveawayBot', 'icon': 'd576e1f184082a3958deea6e8bbbac06', 'description': '🎉 **https://giveawaybot.party**\n\nA bot for hosting giveaways! \nSimply add the bot to your server and type `!ghelp` for a list of commands!', 'summary': '', 'type': None, 'bot': {'id': '294882584201003009', 'username': 'GiveawayBot', 'avatar': '4bfd18c35f26a86f2b5b4eb2ad81a1f7', 'avatar_decoration': None, 'discriminator': '2381', 'public_flags': 589824, 'bot': True}}, {'id': '234395307759108106', 'name': 'Groovy', 'icon': '0e7adc5d634d957b7725021c067bfd87', 'description': 'Groovy has ended its service. Learn more here: https://groovy.bot', 'summary': '', 'type': 1, 'bot': {'id': '234395307759108106', 'username': 'Groovy', 'avatar': '0e7adc5d634d957b7725021c067bfd87', 'avatar_decoration': None, 'discriminator': '7254', 'public_flags': 589824, 'bot': True}}, {'id': '909280922375954433', 'name': 'danketsu', 'icon': '2b3cfac0a8b4c1e24015f06b292f3bd1', 'description': '', 'summary': '', 'type': None, 'bot': {'id': '909280922375954433', 'username': 'Pipidastr', 'avatar': '0f0cc6bf180b9f96dc2ca53fe3e29ece', 'avatar_decoration': None, 'discriminator': '4645', 'public_flags': 0, 'bot': True}}, {'id': '464272403766444044', 'name': 'SD.C Monitoring', 'icon': '6e37a7a3ea3c282e7ed555f2c25e3ff8', 'description': '**>** Апнуть сервер — ``/up``\n**>** Добавить бота — https://server-discord.com/add\n**>** Сервер поддержки — https://discord.gg/8KKVhTU', 'summary': '', 'type': None, 'cover_image': 'f72dda8c2ecc2023267dc78c5203105a', 'bot': {'id': '464272403766444044', 'username': 'SD.C Monitoring', 'avatar': '07aa9c2977eb2c12f4be6d8776cf213e', 'avatar_decoration': None, 'discriminator': '9896', 'public_flags': 65536, 'bot': True}}, {'id': '315926021457051650', 'name': 'Server Monitoring', 'icon': 'f90b3947729c79fc37e9ab9d0befc37f', 'description': 'MyServer.gg - Public Discord Server list. Let everyone know about your server. Find the best server for yourself.', 'summary': '', 'type': None, 'bot': {'id': '315926021457051650', 'username': 'Server Monitoring', 'avatar': 'f90b3947729c79fc37e9ab9d0befc37f', 'avatar_decoration': None, 'discriminator': '8312', 'public_flags': 65536, 'bot': True}}, {'id': '204255083083333633', 'name': 'YAGPDB.xyz', 'icon': '2fa57b425415134d4f8b279174131ad6', 'description': '**Y**et **A**nother **G**eneral **P**urpose **D**iscord **B**ot\nWebsite: https://yagpdb.xyz\nDocs: https://docs.yagpdb.xyz\nSupport: https://discord.gg/4udtcA5\nPartner bots: https://botlabs.gg/bots', 'summary': '', 'type': 1, 'bot': {'id': '204255221017214977', 'username': 'YAGPDB.xyz', 'avatar': '3b376fff30bfb0be0fac67003e0f8dcf', 'avatar_decoration': None, 'discriminator': '8760', 'public_flags': 65536, 'bot': True}}, {'id': '920386902413156432', 'name': 'Tickets | [ Beta ]', 'icon': '6a91c3f578c91555b4d184496222a2ac', 'description': '', 'summary': '', 'type': None, 'bot': {'id': '920386902413156432', 'username': 'Yui - /ticket', 'avatar': '7c372d4cd2c8278f55336b407e87af7f', 'avatar_decoration': None, 'discriminator': '5111', 'public_flags': 0, 'bot': True}}, {'id': '939943092759441448', 'name': 'Yukine', 'icon': '8ef8be73d5cb5cfb029d45aa58711dbc', 'description': 'https://t.me/yukine_discord — канал, в котором я буду постить обновления и различные плюшки', 'summary': '', 'type': None, 'bot': {'id': '939943092759441448', 'username': 'Yukine', 'avatar': '8ef8be73d5cb5cfb029d45aa58711dbc', 'avatar_decoration': None, 'discriminator': '8347', 'public_flags': 524288, 'bot': True}}, {'id': '773933041121755146', 'name': 'Amy', 'icon': '0195642d0fd661a7f2fd609f453cd2e6', 'description': '', 'summary': '', 'type': None, 'bot': {'id': '773933041121755146', 'username': 'Аmy', 'avatar': '0195642d0fd661a7f2fd609f453cd2e6', 'avatar_decoration': None, 'discriminator': '2423', 'public_flags': 0, 'bot': True}}, {'id': '773933982919163984', 'name': 'MOD', 'icon': 'c9ced390cce4fbfc3a1bb0c4b03cb0d9', 'description': '', 'summary': '', 'type': None, 'bot': {'id': '773933982919163984', 'username': 'Огузок', 'avatar': 'c86b112bc32763091fbbccda44bb4c72', 'avatar_decoration': None, 'discriminator': '0835', 'public_flags': 0, 'bot': True}}], 'application_commands': [{'id': '977241824315965510', 'application_id': '939943092759441448', 'version': '977241824315965512', 'default_permission': True, 'default_member_permissions': None, 'type': 1, 'name': 'clan', 'description': 'Взаимодействие с кланами.', 'dm_permission': True, 'options': [{'type': 2, 'name': 'buy', 'description': 'Покупка', 'options': [{'type': 1, 'name': 'badge', 'description': 'Купить эмблему клана', 'options': [{'type': 4, 'name': 'номер', 'description': 'Выберите эмблему', 'required': True, 'choices': [{'name': 'Эмблема 1', 'value': 1}, {'name': 'Эмблема 2', 'value': 2}, {'name': 'Эмблема 3', 'value': 3}, {'name': 'Эмблема 4', 'value': 4}, {'name': 'Эмблема 5', 'value': 5}, {'name': 'Эмблема 6', 'value': 6}, {'name': 'Эмблема 7', 'value': 7}]}]}, {'type': 1, 'name': 'profile', 'description': 'Купить профиль клана', 'options': [{'type': 4, 'name': 'номер', 'description': 'Выберите эмблему', 'required': True, 'choices': [{'name': 'Профиль 1', 'value': 1}, {'name': 'Профиль 2', 'value': 2}, {'name': 'Профиль 3', 'value': 3}, {'name': 'Профиль 4', 'value': 4}, {'name': 'Профиль 5', 'value': 5}]}]}, {'type': 1, 'name': 'deputy', 'description': 'Купить слот заместителя клана'}]}, {'type': 1, 'name': 'clear', 'description': 'Очистка участников клана, покинувших сервер.'}, {'type': 1, 'name': 'create', 'description': 'Создать клан.', 'options': [{'type': 3, 'name': 'название', 'description': 'Укажите название.', 'required': True}, {'type': 3, 'name': 'цвет', 'description': 'Укажите цвет.', 'required': True}, {'type': 6, 'name': 'владелец', 'description': 'Укажите владельца.', 'required': True}, {'type': 7, 'name': 'канал', 'description': 'Укажите текстовый канал'}]}, {'type': 1, 'name': 'edit', 'description': 'Изменить клан.', 'options': [{'type': 3, 'name': 'название', 'description': 'Укажите новое название.'}, {'type': 3, 'name': 'цвет', 'description': 'Укажите новый цвет роли.'}, {'type': 10, 'name': 'слоты', 'description': 'Выберите количество слотов, которое вы хотите докупить.', 'choices': [{'name': '5 слотов', 'value': 5}, {'name': '10 слотов', 'value': 10}, {'name': '15 слотов', 'value': 15}, {'name': '20 слотов', 'value': 20}, {'name': '25 слотов', 'value': 25}, {'name': '30 слотов', 'value': 30}, {'name': '35 слотов', 'value': 35}, {'name': '40 слотов', 'value': 40}, {'name': '45 слотов', 'value': 45}, {'name': '50 слотов', 'value': 50}, {'name': '55 слотов', 'value': 55}, {'name': '60 слотов', 'value': 60}, {'name': '65 слотов', 'value': 65}, {'name': '70 слотов', 'value': 70}, {'name': '75 слотов', 'value': 75}, {'name': '80 слотов', 'value': 80}, {'name': '85 слотов', 'value': 85}, {'name': '90 слотов', 'value': 90}, {'name': '95 слотов', 'value': 95}, {'name': '100 слотов', 'value': 100}]}]}, {'type': 1, 'name': 'delete', 'description': 'Удалить клан.', 'options': [{'type': 6, 'name': 'участник', 'description': 'Укажите любого участника клана.', 'required': True}]}, {'type': 1, 'name': 'deposit', 'description': 'Перевести средства на счёт клана.', 'options': [{'type': 10, 'name': 'количество', 'description': 'Введите количество.', 'required': True}]}, {'type': 1, 'name': 'invite', 'description': 'Пригласить пользователя в клан.', 'options': [{'type': 6, 'name': 'пользователь', 'description': 'Выберите пользователя.', 'required': True}]}, {'type': 1, 'name': 'kick', 'description': 'Выгнать участника из клана.', 'options': [{'type': 6, 'name': 'участник', 'description': 'Выберите участника.', 'required': True}]}, {'type': 1, 'name': 'leave', 'description': 'Покинуть клан.'}, {'type': 1, 'name': 'member', 'description': 'Посмотреть профиль участника клана', 'options': [{'type': 6, 'name': 'участник', 'description': 'Выберите участника'}]}, {'type': 1, 'name': 'members', 'description': 'Посмотреть список участников клана.', 'options': [{'type': 6, 'name': 'участник', 'description': 'Выберите участника'}]}, {'type': 1, 'name': 'points', 'description': 'Добавить очки клану', 'options': [{'type': 6, 'name': 'участник', 'description': 'Укажите любого участника этого клана.', 'required': True}, {'type': 10, 'name': 'количество', 'description': 'Укажите количество.', 'required': True}]}, {'type': 1, 'name': 'profile', 'description': 'Посмотреть профиль клана.', 'options': [{'type': 6, 'name': 'участник', 'description': 'Выберите участника клана'}]}, {'type': 1, 'name': 'shop', 'description': 'Посмотреть магазин клана.'}, {'type': 1, 'name': 'top', 'description': 'Посмотреть топ кланов.'}, {'type': 1, 'name': 'transfer', 'description': 'Передать овнерку клана.', 'options': [{'type': 6, 'name': 'владелец', 'description': 'Укажите владельца клана.', 'required': True}, {'type': 6, 'name': 'участник', 'description': 'Укажите нового владельца клана.', 'required': True}]}, {'type': 1, 'name': 'verify', 'description': 'Верифицировать клан.', 'options': [{'type': 6, 'name': 'участник', 'description': 'Укажите любого участника клана.', 'required': True}]}, {'type': 1, 'name': 'yuki', 'description': 'Добавить валюты клану пользователя.', 'options': [{'type': 6, 'name': 'участник', 'description': 'Укажите любого участника клана.', 'required': True}, {'type': 4, 'name': 'количество', 'description': 'Укажите количество средств', 'required': True}]}]}], 'cursor': {'previous': None, 'next': None, 'repaired': None}}
2022-07-03 17:21:41,954:DEBUG:discord.gateway: Gateway event: {'t': 'MESSAGE_CREATE', 's': 293538, 'op': 0, 'd': {'type': 0, 'tts': False, 'timestamp': '2022-07-03T14:21:41.859000+00:00', 'referenced_message': None, 'pinned': False, 'nonce': '993159605540356096', 'mentions': [], 'mention_roles': [], 'mention_everyone': False, 'member': {'roles': ['848876820103036928', '848876826415071233', '969271706814410752', '982328070117687426', '946854795019452486', '974485074508664902', '979132390075146310', '983482926652080168', '972453596442554378', '965413065539584091', '848876814210170910', '967425133310509083', '963218410479710270', '932991162644578335'], 'premium_since': None, 'pending': False, 'nick': 'sollwir', 'mute': False, 'joined_at': '2021-09-01T11:59:05.555000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'avatar': None}, 'id': '993159605058277406', 'flags': 0, 'embeds': [], 'edited_timestamp': None, 'content': '😳', 'components': [], 'channel_id': '848876592415768577', 'author': {'username': 'sollwirik', 'public_flags': 0, 'id': '881960990714003547', 'discriminator': '8257', 'avatar_decoration': None, 'avatar': '82a6bccbca9c7dc99cfb3bc0bcfe6cd6'}, 'attachments': [], 'guild_id': '254958490676625408'}}.
2022-07-03 17:21:41,954:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:41,954:DEBUG:discord.gateway: Parsing event MESSAGE_CREATE.
2022-07-03 17:21:41,954:DEBUG:discord.client: Dispatching event message.
2022-07-03 17:21:42,221:DEBUG:discord.gateway: Gateway event: {'t': 'GUILD_MEMBER_LIST_UPDATE', 's': 293539, 'op': 0, 'd': {'ops': [{'op': 'UPDATE', 'item': {'member': {'user': {'username': 'Reey', 'public_flags': 0, 'id': '815463907974971454', 'discriminator': '3623', 'bot': False, 'avatar': 'ef41026089c0beced9720cd3d3c07136'}, 'roles': ['957086833253179392', '957093372860956702', '896483861746315354', '957100713719255101', '957093466800816158'], 'presence': {'user': {'id': '815463907974971454'}, 'status': 'dnd', 'game': {'type': 4, 'state': 'я люблю его большe, чем я люблю сeбя.', 'session_id': None, 'name': 'Custom Status', 'id': 'custom', 'emoji': {'name': '🌿'}, 'created_at': 1656858102148}, 'client_status': {'desktop': 'dnd'}, 'activities': [{'type': 4, 'state': 'я люблю его большe, чем я люблю сeбя.', 'name': 'Custom Status', 'id': 'custom', 'emoji': {'name': '🌿'}, 'created_at': 1656858102148}, {'type': 2, 'timestamps': {'start': 1656858091937, 'end': 1656858215472}, 'sync_id': '2fXABiA2F7hqC9qO0R1nwW', 'state': 'nowkie', 'session_id': 'b81720d6e5df2ed473932fc3ca89b88e', 'party': {'id': 'spotify:815463907974971454'}, 'name': 'Spotify', 'id': 'spotify:1', 'flags': 48, 'details': 'Врёшь', 'created_at': 1656858102148, 'assets': {'large_text': 'Врёшь', 'large_image': 'spotify:ab67616d0000b2730dc193455aaceafe40d48cb2'}}]}, 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2022-03-26T15:06:23.372000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'avatar': None}}, 'index': 36}], 'online_count': 467, 'member_count': 817, 'id': 'everyone', 'guild_id': '869928531621195777', 'groups': [{'id': '877569553884913744', 'count': 3}, {'id': '931670859712708698', 'count': 8}, {'id': '869929285312450630', 'count': 5}, {'id': '869929410961231872', 'count': 4}, {'id': '943560933228294154', 'count': 5}, {'id': '957100713719255101', 'count': 10}, {'id': '957898044811116579', 'count': 3}, {'id': '958588195480694806', 'count': 6}, {'id': '896438979635855420', 'count': 1}, {'id': '896438969816993834', 'count': 1}, {'id': '896438977366732821', 'count': 2}, {'id': '896438979988164618', 'count': 2}, {'id': '896438983695925359', 'count': 2}, {'id': '896438984329269319', 'count': 1}, {'id': '896438985319137331', 'count': 2}, {'id': '974003445117902869', 'count': 2}, {'id': '901617395490238475', 'count': 1}, {'id': '896438986543890432', 'count': 1}, {'id': '896482858124861540', 'count': 1}, {'id': '957130169817133087', 'count': 4}, {'id': '896438982810947624', 'count': 2}, {'id': '943560931068227605', 'count': 3}, {'id': '946873955350904932', 'count': 1}, {'id': '943560928916570154', 'count': 2}, {'id': '943560921979175023', 'count': 3}, {'id': '943560925913440276', 'count': 1}, {'id': '957093372860956702', 'count': 2}, {'id': '957093405270376490', 'count': 1}, {'id': '957093411607941131', 'count': 4}, {'id': '957093415198265414', 'count': 1}, {'id': '957898047612936202', 'count': 2}, {'id': '957898074326454283', 'count': 1}, {'id': '957898054969733150', 'count': 1}, {'id': '957898054818750464', 'count': 2}, {'id': '957898057436000326', 'count': 3}, {'id': '962357874590351431', 'count': 1}, {'id': '967013978884673537', 'count': 1}, {'id': '964917726130884708', 'count': 1}, {'id': '941318364880576612', 'count': 1}, {'id': '895724316350615572', 'count': 7}, {'id': '895728114108362752', 'count': 10}, {'id': '895728494154219542', 'count': 11}, {'id': '895728515952037979', 'count': 6}, {'id': '895728517575217184', 'count': 7}, {'id': '895728516837015572', 'count': 12}, {'id': '896486090381332502', 'count': 6}, {'id': '896446353121607720', 'count': 3}, {'id': '895731632332484638', 'count': 1}, {'id': '898941704479068202', 'count': 7}, {'id': '895728985357578280', 'count': 6}, {'id': '895728520393814047', 'count': 4}, {'id': '901613058345013268', 'count': 4}, {'id': '895728984589996063', 'count': 3}, {'id': '895728982849359913', 'count': 2}, {'id': '974002912445481001', 'count': 13}, {'id': '895728519584313374', 'count': 4}, {'id': '951941962578153493', 'count': 2}, {'id': '943560905252282429', 'count': 7}, {'id': '932262021087498270', 'count': 3}, {'id': '943562023676051516', 'count': 2}, {'id': '946395730178895963', 'count': 6}, {'id': '943561992466223114', 'count': 4}, {'id': '980794385497223168', 'count': 6}, {'id': '957093466800816158', 'count': 8}, {'id': '957093471649398834', 'count': 16}, {'id': '957094736915738704', 'count': 11}, {'id': '957094742968135730', 'count': 5}, {'id': '957898059323441153', 'count': 5}, {'id': '957898070492860466', 'count': 4}, {'id': '957898074401943562', 'count': 2}, {'id': '958588886882328666', 'count': 8}, {'id': '958589521736376380', 'count': 14}, {'id': '958589635527839754', 'count': 8}, {'id': '963180637454475364', 'count': 2}, {'id': '967014005807931422', 'count': 17}, {'id': '899655777290190908', 'count': 3}, {'id': 'online', 'count': 62}, {'id': 'offline', 'count': 419}]}}.
2022-07-03 17:21:42,222:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:42,222:DEBUG:discord.gateway: Parsing event GUILD_MEMBER_LIST_UPDATE.
2022-07-03 17:21:42,222:DEBUG:discord.client: Dispatching event raw_member_list_update.
2022-07-03 17:21:42,222:DEBUG:discord.client: Dispatching event presence_update.
2022-07-03 17:21:42,246:DEBUG:discord.http: POST https://discord.com/api/v9/interactions with <aiohttp.formdata.FormData object at 0x7ff1c87ff3d0> has returned 204.
2022-07-03 17:21:42,246:DEBUG:discord.http: POST https://discord.com/api/v9/interactions has received 
2022-07-03 17:21:42,262:DEBUG:discord.gateway: Gateway event: {'t': 'INTERACTION_CREATE', 's': 293540, 'op': 0, 'd': {'nonce': '993159605322252288', 'id': '993159606190751785'}}.
2022-07-03 17:21:42,262:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:42,262:DEBUG:discord.gateway: Parsing event INTERACTION_CREATE.
2022-07-03 17:21:42,262:DEBUG:discord.client: Dispatching event interaction.
2022-07-03 17:21:42,343:DEBUG:discord.gateway: Gateway event: {'t': 'MESSAGE_CREATE', 's': 293541, 'op': 0, 'd': {'webhook_id': '970127970519892009', 'type': 20, 'tts': False, 'timestamp': '2022-07-03T14:21:42.255000+00:00', 'pinned': False, 'nonce': '993159531028545536', 'mentions': [], 'mention_roles': [], 'mention_everyone': False, 'member': {'roles': ['849425199076999168', '848876812590776322'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2022-05-03T00:47:22.167313+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'avatar': None}, 'interaction': {'user': {'username': 'gluttony', 'public_flags': 256, 'id': '528248187920711681', 'discriminator': '4146', 'avatar_decoration': None, 'avatar': '3c59d33b553785c985599add3711cf10'}, 'type': 2, 'name': 'dice', 'member': {'roles': ['848876826415071233', '848876812590776322', '848876818160287754', '987413247726616617'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2022-07-01T17:26:44.407000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'avatar': None}, 'id': '993159605666459648'}, 'id': '993159606719234158', 'flags': 128, 'embeds': [], 'edited_timestamp': None, 'content': '', 'components': [], 'channel_id': '848876598554918913', 'author': {'username': 'GameStorage', 'public_flags': 0, 'id': '970127970519892009', 'discriminator': '3705', 'bot': True, 'avatar_decoration': None, 'avatar': '026548dc73fa87ab856d1953ac3e9ba7'}, 'attachments': [], 'application_id': '970127970519892009', 'guild_id': '254958490676625408'}}.
2022-07-03 17:21:42,344:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:42,344:DEBUG:discord.gateway: Parsing event MESSAGE_CREATE.
2022-07-03 17:21:42,344:DEBUG:discord.client: Dispatching event message.
2022-07-03 17:21:42,369:DEBUG:discord.gateway: Gateway event: {'t': 'VOICE_STATE_UPDATE', 's': 293542, 'op': 0, 'd': {'member': {'user': {'username': 'Hinik', 'public_flags': 0, 'id': '548104721546870794', 'discriminator': '7154', 'bot': False, 'avatar': '8ff4b0add15bfb99213c02b5e20324d9'}, 'roles': ['848876814210170910'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2022-07-03T09:19:32.167000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'avatar': None}, 'user_id': '548104721546870794', 'suppress': False, 'session_id': 'b2bebb470eb7eb137e2be755b7bf4e0e', 'self_video': False, 'self_mute': False, 'self_deaf': False, 'request_to_speak_timestamp': None, 'mute': False, 'guild_id': '254958490676625408', 'deaf': False, 'channel_id': '848876684739477534'}}.
2022-07-03 17:21:42,370:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:42,370:DEBUG:discord.gateway: Parsing event VOICE_STATE_UPDATE.
2022-07-03 17:21:42,370:DEBUG:discord.client: Dispatching event voice_state_update.
2022-07-03 17:21:42,409:DEBUG:discord.gateway: Gateway event: {'t': 'INTERACTION_CREATE', 's': 293543, 'op': 0, 'd': {'id': '993159606991851651'}}.
2022-07-03 17:21:42,410:DEBUG:discord.client: Dispatching event socket_event_type.
2022-07-03 17:21:42,410:DEBUG:discord.gateway: Parsing event INTERACTION_CREATE.
dolfies commented 2 years ago

I- It doesn't even look like it's triggered. I'll push a commit that drops interactions without nonces.

dolfies commented 2 years ago

Do you have another client (selfbot or not) running on the same account by any chance?