dolfies / discord.py-self

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

on_modal doesnt work #726

Closed theAbdoSabbagh closed 3 months ago

theAbdoSabbagh commented 3 months ago

Summary

i tried waiting for the modal event to happen, the modal in the app appeared, in the code it didnt

Reproduction Steps

just make a on_modal event listener and in discord make a modal appear from some bot

Code

No response

Expected Results

on_modal should work, it doesnt

Actual Results

on_modal doesnt work

System Information

Checklist

Additional Information

No response

MCausc78 commented 3 months ago

Please run bot with bot.run('token', log_level=logging.DEBUG) and share logs. "doesn't work" doesn't make much sense.

theAbdoSabbagh commented 3 months ago

Please run bot with bot.run('token', log_level=logging.DEBUG) and share logs. "doesn't work" doesn't make much sense.

Ok, will do that in the morning and post the logs

theAbdoSabbagh commented 3 months ago

Please run bot with bot.run('token', log_level=logging.DEBUG) and share logs. "doesn't work" doesn't make much sense.

Sorry for 2 weeks delay, got caught up in other things. So the problem is when I open a modal in discord, such as the image attached, discord.py-self doesnt recognize it, and it doesnt execute the on_modal event

Logs:

2024-08-22 16:55:36 DEBUG    discord.gateway Gateway event: {'t': 'MESSAGE_UPDATE', 's': 4, 'op': 0, 'd': {'webhook_id': '1214979981139124224', 'type': 19, 'tts': False, 'timestamp': '2024-08-22T12:55:31.860000+00:00', 'position': 0, 'pinned': False, 'message_reference': {'type': 0, 'message_id': '1276162801974513764', 'guild_id': '1214931244819943474', 'channel_id': '1214932774298067014'}, 'mentions': [{'username': 'amielishere', 'public_flags': 0, 'member': {'roles': ['1214931685787836416', '1219041238766846084', '1270535467162664997', '1214931819279949865', '1214931838829723658', '1214931889173958697', '1215418977937789038', '1214931835654770801', '1214931837193945140', '1214931871943761940', '1214931791660458008'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-07-04T06:19:32.124000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}], 'mention_roles': [], 'mention_everyone': False, 'member': {'roles': ['1214931685787836416', '1214931632805519360', '1214931889173958697', '1214931838829723658', '1214931819279949865', '1215418977937789038', '1214931837193945140', '1214931871943761940', '1214931598525472789', '1245188439381639223', '1214931791660458008', '1214931638283403284', '1214931654221766748'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-05-29T01:34:18.509000+00:00', 'flags': 1, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'interaction_metadata': {'user': {'username': 'amielishere', 'public_flags': 0, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}, 'type': 5, 'triggering_interaction_metadata': {'user': {'username': 'amielishere', 'public_flags': 0, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}, 'type': 3, 'interacted_message_id': '1276162801974513764', 'id': '1276162816340136038', 'authorizing_integration_owners': {'0': '1214931244819943474'}}, 'original_response_message_id': '1276162801974513764', 'id': '1276162840654512178', 'authorizing_integration_owners': {'0': '1214931244819943474'}}, 'id': '1276162843544256589', 'flags': 0, 'embeds': [], 'edited_timestamp': '2024-08-22T12:55:34.866155+00:00', 'content': "<@1092003703222980649> You're safe! Keep going. Total revealed spots: 1 out of 22\n<:leftpro:1215376093817741322> Possible win: 1,08x multiplier, payout on stop: 2,16 <:wl:1215375023192416286>\n<:add:1215364293000831016> Profit: 0,16 <:wl:1215375023192416286>", 'components': [{'type': 1, 'id': 1, 'components': [{'type': 2, 'style': 2, 'label': '1', 'id': 2, 'custom_id': 'mine_0_27737'}, {'type': 2, 'style': 2, 'label': '2', 'id': 3, 'custom_id': 'mine_1_27737'}, {'type': 2, 'style': 2, 'label': '3', 'id': 4, 'custom_id': 'mine_2_27737'}, {'type': 2, 'style': 2, 'label': '4', 'id': 5, 'custom_id': 'mine_3_27737'}, {'type': 2, 'style': 2, 'label': '5', 'id': 6, 'custom_id': 'mine_4_27737'}]}, {'type': 1, 'id': 7, 'components': [{'type': 2, 'style': 2, 'label': '6', 'id': 8, 'custom_id': 'mine_5_27737'}, {'type': 2, 'style': 2, 'label': '7', 'id': 9, 'custom_id': 'mine_6_27737'}, {'type': 2, 'style': 2, 'label': '8', 'id': 10, 'custom_id': 'mine_7_27737'}, {'type': 2, 'style': 2, 'label': '9', 'id': 11, 'custom_id': 'mine_8_27737'}, {'type': 2, 'style': 2, 'label': '10', 'id': 12, 'custom_id': 'mine_9_27737'}]}, {'type': 1, 'id': 13, 'components': [{'type': 2, 'style': 2, 'label': '11', 'id': 14, 'custom_id': 'mine_10_27737'}, {'type': 2, 'style': 2, 'label': '12', 'id': 15, 'custom_id': 'mine_11_27737'}, {'type': 2, 'style': 2, 'label': '13', 'id': 16, 'custom_id': 'mine_12_27737'}, {'type': 2, 'style': 2, 'label': '14', 'id': 17, 'custom_id': 'mine_13_27737'}, {'type': 2, 'style': 2, 'label': '15', 'id': 18, 'custom_id': 'mine_14_27737'}]}, {'type': 1, 'id': 19, 'components': [{'type': 2, 'style': 2, 'label': '16', 'id': 20, 'custom_id': 'mine_15_27737'}, {'type': 2, 'style': 2, 'label': '17', 'id': 21, 'custom_id': 'mine_16_27737'}, {'type': 2, 'style': 2, 'label': '18', 'id': 22, 'custom_id': 'mine_17_27737'}, {'type': 2, 'style': 2, 'label': '19', 'id': 23, 'custom_id': 'mine_18_27737'}, {'type': 2, 'style': 2, 'label': '20', 'id': 24, 'custom_id': 'mine_19_27737'}]}, {'type': 1, 'id': 25, 'components': [{'type': 2, 'style': 2, 'label': '21', 'id': 26, 'custom_id': 'mine_20_27737'}, {'type': 2, 'style': 2, 'label': '22', 'id': 27, 'custom_id': 'mine_21_27737'}, {'type': 2, 'style': 2, 'label': '23', 'id': 28, 'custom_id': 'mine_22_27737'}, {'type': 2, 'style': 3, 'label': '24', 'id': 29, 'custom_id': 'mine_23_27737'}, {'type': 2, 'style': 4, 'label': 'Stop Game', 'id': 30, 'custom_id': 'stop_game_mines_27737'}]}], 'channel_id': '1214932774298067014', 'author': {'username': 'Growtopian', 'public_flags': 0, 'id': '1214979981139124224', 'global_name': None, 'discriminator': '8354', 'clan': None, 'bot': True, 'avatar_decoration_data': None, 'avatar': 'e5d02adaeaccc420a9adfd03a1134bed'}, 'attachments': [], 'application_id': '1214979981139124224', 'guild_id': '1214931244819943474'}}.
2024-08-22 16:55:36 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:36 DEBUG    discord.gateway Parsing event MESSAGE_UPDATE.
2024-08-22 16:55:36 DEBUG    discord.client Dispatching event raw_message_edit.
2024-08-22 16:55:36 DEBUG    discord.gateway Subscribing to guilds with payload {'subscriptions': {'1214931244819943474': {'typing': True, 'threads': True, 'activities': True, 'member_updates': True}}}
2024-08-22 16:55:36 DEBUG    discord.gateway Gateway event: {'t': 'THREAD_LIST_SYNC', 's': 5, 'op': 0, 'd': {'threads': [], 'most_recent_messages': [], 'guild_id': '1214931244819943474'}}.
2024-08-22 16:55:36 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:36 DEBUG    discord.gateway Parsing event THREAD_LIST_SYNC.
2024-08-22 16:55:38 DEBUG    discord.gateway Gateway event: {'t': 'MESSAGE_ACK', 's': 6, 'op': 0, 'd': {'version': 1612, 'message_id': '1276162843544256589', 'last_viewed': 3522, 'flags': None, 'channel_id': '1214932774298067014'}}.
2024-08-22 16:55:38 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:38 DEBUG    discord.gateway Parsing event MESSAGE_ACK.
2024-08-22 16:55:38 DEBUG    discord.client Dispatching event raw_message_ack.
2024-08-22 16:55:39 DEBUG    discord.gateway Gateway event: {'t': 'MESSAGE_UPDATE', 's': 7, 'op': 0, 'd': {'webhook_id': '1214979981139124224', 'type': 19, 'tts': False, 'timestamp': '2024-08-22T12:55:31.860000+00:00', 'position': 0, 'pinned': False, 'message_reference': {'type': 0, 'message_id': '1276162801974513764', 'guild_id': '1214931244819943474', 'channel_id': '1214932774298067014'}, 'mentions': [{'username': 'amielishere', 'public_flags': 0, 'member': {'roles': ['1214931685787836416', '1219041238766846084', '1270535467162664997', '1214931819279949865', '1214931838829723658', '1214931889173958697', '1215418977937789038', '1214931835654770801', '1214931837193945140', '1214931871943761940', '1214931791660458008'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-07-04T06:19:32.124000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}], 'mention_roles': [], 'mention_everyone': False, 'member': {'roles': ['1214931685787836416', '1214931632805519360', '1214931889173958697', '1214931838829723658', '1214931819279949865', '1215418977937789038', '1214931837193945140', '1214931871943761940', '1214931598525472789', '1245188439381639223', '1214931791660458008', '1214931638283403284', '1214931654221766748'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-05-29T01:34:18.509000+00:00', 'flags': 1, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'interaction_metadata': {'user': {'username': 'amielishere', 'public_flags': 0, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}, 'type': 5, 'triggering_interaction_metadata': {'user': {'username': 'amielishere', 'public_flags': 0, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}, 'type': 3, 'interacted_message_id': '1276162801974513764', 'id': '1276162816340136038', 'authorizing_integration_owners': {'0': '1214931244819943474'}}, 'original_response_message_id': '1276162801974513764', 'id': '1276162840654512178', 'authorizing_integration_owners': {'0': '1214931244819943474'}}, 'id': '1276162843544256589', 'flags': 0, 'embeds': [], 'edited_timestamp': '2024-08-22T12:55:38.499388+00:00', 'content': "<@1092003703222980649> You're safe! Keep going. Total revealed spots: 2 out of 22\n<:leftpro:1215376093817741322> Possible win: 1,18x multiplier, payout on stop: 2,36 <:wl:1215375023192416286>\n<:add:1215364293000831016> Profit: 0,36 <:wl:1215375023192416286>", 'components': [{'type': 1, 'id': 1, 'components': [{'type': 2, 'style': 2, 'label': '1', 'id': 2, 'custom_id': 'mine_0_27737'}, {'type': 2, 'style': 2, 'label': '2', 'id': 3, 'custom_id': 'mine_1_27737'}, {'type': 2, 'style': 2, 'label': '3', 'id': 4, 'custom_id': 'mine_2_27737'}, {'type': 2, 'style': 2, 'label': '4', 'id': 5, 'custom_id': 'mine_3_27737'}, {'type': 2, 'style': 2, 'label': '5', 'id': 6, 'custom_id': 'mine_4_27737'}]}, {'type': 1, 'id': 7, 'components': [{'type': 2, 'style': 2, 'label': '6', 'id': 8, 'custom_id': 'mine_5_27737'}, {'type': 2, 'style': 2, 'label': '7', 'id': 9, 'custom_id': 'mine_6_27737'}, {'type': 2, 'style': 2, 'label': '8', 'id': 10, 'custom_id': 'mine_7_27737'}, {'type': 2, 'style': 2, 'label': '9', 'id': 11, 'custom_id': 'mine_8_27737'}, {'type': 2, 'style': 2, 'label': '10', 'id': 12, 'custom_id': 'mine_9_27737'}]}, {'type': 1, 'id': 13, 'components': [{'type': 2, 'style': 3, 'label': '11', 'id': 14, 'custom_id': 'mine_10_27737'}, {'type': 2, 'style': 2, 'label': '12', 'id': 15, 'custom_id': 'mine_11_27737'}, {'type': 2, 'style': 2, 'label': '13', 'id': 16, 'custom_id': 'mine_12_27737'}, {'type': 2, 'style': 2, 'label': '14', 'id': 17, 'custom_id': 'mine_13_27737'}, {'type': 2, 'style': 2, 'label': '15', 'id': 18, 'custom_id': 'mine_14_27737'}]}, {'type': 1, 'id': 19, 'components': [{'type': 2, 'style': 2, 'label': '16', 'id': 20, 'custom_id': 'mine_15_27737'}, {'type': 2, 'style': 2, 'label': '17', 'id': 21, 'custom_id': 'mine_16_27737'}, {'type': 2, 'style': 2, 'label': '18', 'id': 22, 'custom_id': 'mine_17_27737'}, {'type': 2, 'style': 2, 'label': '19', 'id': 23, 'custom_id': 'mine_18_27737'}, {'type': 2, 'style': 2, 'label': '20', 'id': 24, 'custom_id': 'mine_19_27737'}]}, {'type': 1, 'id': 25, 'components': [{'type': 2, 'style': 2, 'label': '21', 'id': 26, 'custom_id': 'mine_20_27737'}, {'type': 2, 'style': 2, 'label': '22', 'id': 27, 'custom_id': 'mine_21_27737'}, {'type': 2, 'style': 2, 'label': '23', 'id': 28, 'custom_id': 'mine_22_27737'}, {'type': 2, 'style': 3, 'label': '24', 'id': 29, 'custom_id': 'mine_23_27737'}, {'type': 2, 'style': 4, 'label': 'Stop Game', 'id': 30, 'custom_id': 'stop_game_mines_27737'}]}], 'channel_id': '1214932774298067014', 'author': {'username': 'Growtopian', 'public_flags': 0, 'id': '1214979981139124224', 'global_name': None, 'discriminator': '8354', 'clan': None, 'bot': True, 'avatar_decoration_data': None, 'avatar': 'e5d02adaeaccc420a9adfd03a1134bed'}, 'attachments': [], 'application_id': '1214979981139124224', 'guild_id': '1214931244819943474'}}.
2024-08-22 16:55:39 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:39 DEBUG    discord.gateway Parsing event MESSAGE_UPDATE.
2024-08-22 16:55:39 DEBUG    discord.client Dispatching event raw_message_edit.
2024-08-22 16:55:41 DEBUG    discord.gateway Gateway event: {'t': 'INTERACTION_CREATE', 's': 8, 'op': 0, 'd': {'nonce': '1276162880714047488', 'id': '1276162877140635670'}}.
2024-08-22 16:55:41 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:41 DEBUG    discord.gateway Parsing event INTERACTION_CREATE.
2024-08-22 16:55:41 DEBUG    discord.client Dispatching event interaction.
2024-08-22 16:55:41 DEBUG    discord.gateway Gateway event: {'t': 'INTERACTION_SUCCESS', 's': 9, 'op': 0, 'd': {'nonce': '1276162880714047488', 'id': '1276162877140635670'}}.
2024-08-22 16:55:41 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:41 DEBUG    discord.gateway Parsing event INTERACTION_SUCCESS.
2024-08-22 16:55:41 DEBUG    discord.client Dispatching event interaction_finish.
2024-08-22 16:55:42 DEBUG    discord.gateway Gateway event: {'t': 'MESSAGE_UPDATE', 's': 10, 'op': 0, 'd': {'webhook_id': '1214979981139124224', 'type': 19, 'tts': False, 'timestamp': '2024-08-22T12:55:31.860000+00:00', 'position': 0, 'pinned': False, 'message_reference': {'type': 0, 'message_id': '1276162801974513764', 'guild_id': '1214931244819943474', 'channel_id': '1214932774298067014'}, 'mentions': [{'username': 'amielishere', 'public_flags': 0, 'member': {'roles': ['1214931685787836416', '1219041238766846084', '1270535467162664997', '1214931819279949865', '1214931838829723658', '1214931889173958697', '1215418977937789038', '1214931835654770801', '1214931837193945140', '1214931871943761940', '1214931791660458008'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-07-04T06:19:32.124000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}], 'mention_roles': [], 'mention_everyone': False, 'member': {'roles': ['1214931685787836416', '1214931632805519360', '1214931889173958697', '1214931838829723658', '1214931819279949865', '1215418977937789038', '1214931837193945140', '1214931871943761940', '1214931598525472789', '1245188439381639223', '1214931791660458008', '1214931638283403284', '1214931654221766748'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-05-29T01:34:18.509000+00:00', 'flags': 1, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'interaction_metadata': {'user': {'username': 'amielishere', 'public_flags': 0, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}, 'type': 5, 'triggering_interaction_metadata': {'user': {'username': 'amielishere', 'public_flags': 0, 'id': '1092003703222980649', 'global_name': 'amielishere', 'discriminator': '0', 'clan': None, 'avatar_decoration_data': None, 'avatar': 'b6434e6df81d3cbe8977a2c3be988a0c'}, 'type': 3, 'interacted_message_id': '1276162801974513764', 'id': '1276162816340136038', 'authorizing_integration_owners': {'0': '1214931244819943474'}}, 'original_response_message_id': '1276162801974513764', 'id': '1276162840654512178', 'authorizing_integration_owners': {'0': '1214931244819943474'}}, 'id': '1276162843544256589', 'flags': 0, 'embeds': [], 'edited_timestamp': '2024-08-22T12:55:40.996691+00:00', 'content': "<@1092003703222980649> You're safe! Keep going. Total revealed spots: 3 out of 22\n<:leftpro:1215376093817741322> Possible win: 1,30x multiplier, payout on stop: 2,60 <:wl:1215375023192416286>\n<:add:1215364293000831016> Profit: 0,60 <:wl:1215375023192416286>", 'components': [{'type': 1, 'id': 1, 'components': [{'type': 2, 'style': 2, 'label': '1', 'id': 2, 'custom_id': 'mine_0_27737'}, {'type': 2, 'style': 2, 'label': '2', 'id': 3, 'custom_id': 'mine_1_27737'}, {'type': 2, 'style': 2, 'label': '3', 'id': 4, 'custom_id': 'mine_2_27737'}, {'type': 2, 'style': 2, 'label': '4', 'id': 5, 'custom_id': 'mine_3_27737'}, {'type': 2, 'style': 2, 'label': '5', 'id': 6, 'custom_id': 'mine_4_27737'}]}, {'type': 1, 'id': 7, 'components': [{'type': 2, 'style': 2, 'label': '6', 'id': 8, 'custom_id': 'mine_5_27737'}, {'type': 2, 'style': 2, 'label': '7', 'id': 9, 'custom_id': 'mine_6_27737'}, {'type': 2, 'style': 2, 'label': '8', 'id': 10, 'custom_id': 'mine_7_27737'}, {'type': 2, 'style': 2, 'label': '9', 'id': 11, 'custom_id': 'mine_8_27737'}, {'type': 2, 'style': 2, 'label': '10', 'id': 12, 'custom_id': 'mine_9_27737'}]}, {'type': 1, 'id': 13, 'components': [{'type': 2, 'style': 3, 'label': '11', 'id': 14, 'custom_id': 'mine_10_27737'}, {'type': 2, 'style': 2, 'label': '12', 'id': 15, 'custom_id': 'mine_11_27737'}, {'type': 2, 'style': 2, 'label': '13', 'id': 16, 'custom_id': 'mine_12_27737'}, {'type': 2, 'style': 2, 'label': '14', 'id': 17, 'custom_id': 'mine_13_27737'}, {'type': 2, 'style': 3, 'label': '15', 'id': 18, 'custom_id': 'mine_14_27737'}]}, {'type': 1, 'id': 19, 'components': [{'type': 2, 'style': 2, 'label': '16', 'id': 20, 'custom_id': 'mine_15_27737'}, {'type': 2, 'style': 2, 'label': '17', 'id': 21, 'custom_id': 'mine_16_27737'}, {'type': 2, 'style': 2, 'label': '18', 'id': 22, 'custom_id': 'mine_17_27737'}, {'type': 2, 'style': 2, 'label': '19', 'id': 23, 'custom_id': 'mine_18_27737'}, {'type': 2, 'style': 2, 'label': '20', 'id': 24, 'custom_id': 'mine_19_27737'}]}, {'type': 1, 'id': 25, 'components': [{'type': 2, 'style': 2, 'label': '21', 'id': 26, 'custom_id': 'mine_20_27737'}, {'type': 2, 'style': 2, 'label': '22', 'id': 27, 'custom_id': 'mine_21_27737'}, {'type': 2, 'style': 2, 'label': '23', 'id': 28, 'custom_id': 'mine_22_27737'}, {'type': 2, 'style': 3, 'label': '24', 'id': 29, 'custom_id': 'mine_23_27737'}, {'type': 2, 'style': 4, 'label': 'Stop Game', 'id': 30, 'custom_id': 'stop_game_mines_27737'}]}], 'channel_id': '1214932774298067014', 'author': {'username': 'Growtopian', 'public_flags': 0, 'id': '1214979981139124224', 'global_name': None, 'discriminator': '8354', 'clan': None, 'bot': True, 'avatar_decoration_data': None, 'avatar': 'e5d02adaeaccc420a9adfd03a1134bed'}, 'attachments': [], 'application_id': '1214979981139124224', 'guild_id': '1214931244819943474'}}.
2024-08-22 16:55:42 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:42 DEBUG    discord.gateway Parsing event MESSAGE_UPDATE.
2024-08-22 16:55:42 DEBUG    discord.client Dispatching event raw_message_edit.
2024-08-22 16:55:43 DEBUG    discord.gateway Gateway event: {'t': 'TYPING_START', 's': 11, 'op': 0, 'd': {'user_id': '706533080122392627', 'timestamp': 1724331342, 'member': {'user': {'username': 'heiqing.', 'public_flags': 0, 'id': '706533080122392627', 'global_name': 'Li Shun Sheng', 'display_name': 'Li Shun Sheng', 'discriminator': '0', 'clan': None, 'bot': False, 'avatar_decoration_data': None, 'avatar': '7e538e1b7377ad2d038fa438a0284e1e'}, 'roles': ['1214931685787836416', '1219041238766846084', '1270535467162664997', '1214931819279949865', '1214931838829723658', '1214931889173958697', '1215418977937789038', '1214931835654770801', '1214931837193945140', '1214931871943761940', '1214931791660458008', '1215390950805737533'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-08-05T14:44:51.890000+00:00', 'flags': 0, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'channel_id': '1225391285276512297', 'guild_id': '1214931244819943474'}}.
2024-08-22 16:55:43 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:43 DEBUG    discord.gateway Parsing event TYPING_START.
2024-08-22 16:55:43 DEBUG    discord.client Dispatching event typing.
2024-08-22 16:55:44 DEBUG    discord.gateway Gateway event: {'t': 'MESSAGE_UPDATE', 's': 12, 'op': 0, 'd': {'type': 0, 'tts': False, 'timestamp': '2024-08-10T17:37:54.826000+00:00', 'pinned': False, 'mentions': [], 'mention_roles': [], 'mention_everyone': False, 'member': {'roles': ['1214931685787836416', '1214931632805519360', '1214931889173958697', '1214931838829723658', '1214931819279949865', '1215418977937789038', '1214931837193945140', '1214931871943761940', '1214931598525472789', '1245188439381639223', '1214931791660458008', '1214931638283403284', '1214931654221766748'], 'premium_since': None, 'pending': False, 'nick': None, 'mute': False, 'joined_at': '2024-05-29T01:34:18.509000+00:00', 'flags': 1, 'deaf': False, 'communication_disabled_until': None, 'banner': None, 'avatar': None}, 'id': '1271885253107122368', 'flags': 0, 'embeds': [{'type': 'rich', 'title': '🌐 Vend Bot Status', 'timestamp': '2024-08-22T12:55:43.319356+00:00', 'footer': {'text': 'Last updated:'}, 'description': '<a:online:1275195405017026643> Online', 'content_scan_version': 0, 'color': 2123412}], 'edited_timestamp': '2024-08-22T12:55:43.477433+00:00', 'content': 'Vend Finder - World Data Updater Bot Status', 'components': [], 'channel_id': '1271884892598435893', 'author': {'username': 'Growtopian', 'public_flags': 0, 'id': '1214979981139124224', 'global_name': None, 'discriminator': '8354', 'clan': None, 'bot': True, 'avatar_decoration_data': None, 'avatar': 'e5d02adaeaccc420a9adfd03a1134bed'}, 'attachments': [], 'guild_id': '1214931244819943474'}}.
2024-08-22 16:55:44 DEBUG    discord.client Dispatching event socket_event_type.
2024-08-22 16:55:44 DEBUG    discord.gateway Parsing event MESSAGE_UPDATE.
2024-08-22 16:55:44 DEBUG    discord.client Dispatching event raw_message_edit.

Modal: image

MCausc78 commented 3 months ago

Please run bot with bot.run('token', log_level=logging.DEBUG) and share logs. "doesn't work" doesn't make much sense.

Sorry for 2 weeks delay, got caught up in other things. So the problem is when I open a modal in discord, such as the image attached, discord.py-self doesnt recognize it, and it doesnt execute the on_modal event

Modal creates are dispatched to only one Gateway session. Creating interaction (clicking button, executing app command, submitting modals) needs session ID (in this case, Discord client session). So intercepting modals is not possible with this library. Unless, interaction is made via library itself. In this case, on_modal will dispatch.

dolfies commented 3 months ago

@MCausc78 explained it perfectly. You never receive another session's interactions. If you want to receive a modal, you have to trigger it through the library.

theAbdoSabbagh commented 3 months ago

@MCausc78 explained it perfectly. You never receive another session's interactions. If you want to receive a modal, you have to trigger it through the library.

Alright, thank you both so much. But the thing is I did that before. The way the modal shows up is after I click a button, and before I tried to replicate this issue by opening a modal manually, I actually did click the button and then wait for on_modal event to dispatch, but it didn't. I'm going to test again though soon and if it doesn't work I'll provide the code and steps to reproduce.