diff --git a/module/Library/DPP.cpp b/module/Library/DPP.cpp index c8d1a73d..45c79bdc 100644 --- a/module/Library/DPP.cpp +++ b/module/Library/DPP.cpp @@ -141,32 +141,32 @@ void DpCluster::OnGuildJoinRequestDelete(const dpp::guild_join_request_delete_t // ------------------------------------------------------------------------------------------------ void DpCluster::OnInteractionCreate(const dpp::interaction_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::InteractionCreate, new dpp::interaction_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::InteractionCreate, new DpInteractionCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnButtonClick(const dpp::button_click_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ButtonClick, new dpp::button_click_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ButtonClick, new DpButtonClickEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnSelectClick(const dpp::select_click_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::SelectClick, new dpp::select_click_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::SelectClick, new DpSelectClickEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildDelete(const dpp::guild_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildDelete, new dpp::guild_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildDelete, new DpGuildDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnChannelDelete(const dpp::channel_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ChannelDelete, new dpp::channel_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ChannelDelete, new DpChannelDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnChannelUpdate(const dpp::channel_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ChannelUpdate, new dpp::channel_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ChannelUpdate, new DpChannelUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnReady(const dpp::ready_t & ev) @@ -176,257 +176,257 @@ void DpCluster::OnReady(const dpp::ready_t & ev) // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageDelete(const dpp::message_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageDelete, new dpp::message_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageDelete, new DpMessageDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnApplicationCommandDelete(const dpp::application_command_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ApplicationCommandDelete, new dpp::application_command_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ApplicationCommandDelete, new DpApplicationCommandDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildMemberRemove(const dpp::guild_member_remove_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildMemberRemove, new dpp::guild_member_remove_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildMemberRemove, new DpGuildMemberRemoveEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnApplicationCommandCreate(const dpp::application_command_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ApplicationCommandCreate, new dpp::application_command_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ApplicationCommandCreate, new DpApplicationCommandCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnResumed(const dpp::resumed_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::Resumed, new dpp::resumed_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::Resumed, new DpResumedEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildRoleCreate(const dpp::guild_role_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildRoleCreate, new dpp::guild_role_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildRoleCreate, new DpGuildRoleCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnTypingStart(const dpp::typing_start_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::TypingStart, new dpp::typing_start_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::TypingStart, new DpTypingStartEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageReactionAdd(const dpp::message_reaction_add_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionAdd, new dpp::message_reaction_add_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionAdd, new DpMessageReactionAddEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildMembersChunk(const dpp::guild_members_chunk_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildMembersChunk, new dpp::guild_members_chunk_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildMembersChunk, new DpGuildMembersChunkEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageReactionRemove(const dpp::message_reaction_remove_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionRemove, new dpp::message_reaction_remove_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionRemove, new DpMessageReactionRemoveEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildCreate(const dpp::guild_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildCreate, new dpp::guild_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildCreate, new DpGuildCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnChannelCreate(const dpp::channel_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ChannelCreate, new dpp::channel_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ChannelCreate, new DpChannelCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageReactionRemoveEmoji(const dpp::message_reaction_remove_emoji_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionRemoveEmoji, new dpp::message_reaction_remove_emoji_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionRemoveEmoji, new DpMessageReactionRemoveEmojiEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageDeleteBulk(const dpp::message_delete_bulk_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageDeleteBulk, new dpp::message_delete_bulk_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageDeleteBulk, new DpMessageDeleteBulkEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildRoleUpdate(const dpp::guild_role_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildRoleUpdate, new dpp::guild_role_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildRoleUpdate, new DpGuildRoleUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildRoleDelete(const dpp::guild_role_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildRoleDelete, new dpp::guild_role_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildRoleDelete, new DpGuildRoleDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnChannelPinsUpdate(const dpp::channel_pins_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ChannelPinsUpdate, new dpp::channel_pins_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ChannelPinsUpdate, new DpChannelPinsUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageReactionRemoveAll(const dpp::message_reaction_remove_all_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionRemoveAll, new dpp::message_reaction_remove_all_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageReactionRemoveAll, new DpMessageReactionRemoveAllEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnVoiceServerUpdate(const dpp::voice_server_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::VoiceServerUpdate, new dpp::voice_server_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::VoiceServerUpdate, new DpVoiceServerUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildEmojisUpdate(const dpp::guild_emojis_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildEmojisUpdate, new dpp::guild_emojis_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildEmojisUpdate, new DpGuildEmojisUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildStickersUpdate(const dpp::guild_stickers_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildStickersUpdate, new dpp::guild_stickers_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildStickersUpdate, new DpGuildStickersUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnPresenceUpdate(const dpp::presence_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::PresenceUpdate, new dpp::presence_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::PresenceUpdate, new DpPresenceUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnWebhooksUpdate(const dpp::webhooks_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::WebhooksUpdate, new dpp::webhooks_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::WebhooksUpdate, new DpWebhooksUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildMemberAdd(const dpp::guild_member_add_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildMemberAdd, new dpp::guild_member_add_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildMemberAdd, new DpGuildMemberAddEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnInviteDelete(const dpp::invite_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::InviteDelete, new dpp::invite_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::InviteDelete, new DpInviteDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildUpdate(const dpp::guild_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildUpdate, new dpp::guild_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildUpdate, new DpGuildUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildIntegrationsUpdate(const dpp::guild_integrations_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildIntegrationsUpdate, new dpp::guild_integrations_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildIntegrationsUpdate, new DpGuildIntegrationsUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildMemberUpdate(const dpp::guild_member_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildMemberUpdate, new dpp::guild_member_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildMemberUpdate, new DpGuildMemberUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnApplicationCommandUpdate(const dpp::application_command_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ApplicationCommandUpdate, new dpp::application_command_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ApplicationCommandUpdate, new DpApplicationCommandUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnInviteCreate(const dpp::invite_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::InviteCreate, new dpp::invite_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::InviteCreate, new DpInviteCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageUpdate(const dpp::message_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageUpdate, new dpp::message_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageUpdate, new DpMessageUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnUserUpdate(const dpp::user_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::UserUpdate, new dpp::user_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::UserUpdate, new DpUserUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnMessageCreate(const dpp::message_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::MessageCreate, new dpp::message_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::MessageCreate, new DpMessageCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildBanAdd(const dpp::guild_ban_add_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildBanAdd, new dpp::guild_ban_add_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildBanAdd, new DpGuildBanAddEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnGuildBanRemove(const dpp::guild_ban_remove_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::GuildBanRemove, new dpp::guild_ban_remove_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::GuildBanRemove, new DpGuildBanRemoveEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnIntegrationCreate(const dpp::integration_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::IntegrationCreate, new dpp::integration_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::IntegrationCreate, new DpIntegrationCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnIntegrationUpdate(const dpp::integration_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::IntegrationUpdate, new dpp::integration_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::IntegrationUpdate, new DpIntegrationUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnIntegrationDelete(const dpp::integration_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::IntegrationDelete, new dpp::integration_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::IntegrationDelete, new DpIntegrationDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnThreadCreate(const dpp::thread_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ThreadCreate, new dpp::thread_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ThreadCreate, new DpThreadCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnThreadUpdate(const dpp::thread_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ThreadUpdate, new dpp::thread_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ThreadUpdate, new DpThreadUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnThreadDelete(const dpp::thread_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ThreadDelete, new dpp::thread_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ThreadDelete, new DpThreadDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnThreadListSync(const dpp::thread_list_sync_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ThreadListSync, new dpp::thread_list_sync_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ThreadListSync, new DpThreadListSyncEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnThreadMemberUpdate(const dpp::thread_member_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ThreadMemberUpdate, new dpp::thread_member_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ThreadMemberUpdate, new DpThreadMemberUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnThreadMembersUpdate(const dpp::thread_members_update_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::ThreadMembersUpdate, new dpp::thread_members_update_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::ThreadMembersUpdate, new DpThreadMembersUpdateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnVoiceBufferSend(const dpp::voice_buffer_send_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::VoiceBufferSend, new dpp::voice_buffer_send_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::VoiceBufferSend, new DpVoiceBufferSendEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnVoiceUserTalking(const dpp::voice_user_talking_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::VoiceUserTalking, new dpp::voice_user_talking_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::VoiceUserTalking, new DpVoiceUserTalkingEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnVoiceReady(const dpp::voice_ready_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::VoiceReady, new dpp::voice_ready_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::VoiceReady, new DpVoiceReadyEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnVoiceReceive(const dpp::voice_receive_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::VoiceReceive, new dpp::voice_receive_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::VoiceReceive, new DpVoiceReceiveEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnVoiceTrackMarker(const dpp::voice_track_marker_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::VoiceTrackMarker, new dpp::voice_track_marker_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::VoiceTrackMarker, new DpVoiceTrackMarkerEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnStageInstanceCreate(const dpp::stage_instance_create_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::StageInstanceCreate, new dpp::stage_instance_create_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::StageInstanceCreate, new DpStageInstanceCreateEvent(ev))); } // ------------------------------------------------------------------------------------------------ void DpCluster::OnStageInstanceDelete(const dpp::stage_instance_delete_t & ev) { - //mQueue.enqueue(DpInternalEvent(DpEventID::StageInstanceDelete, new dpp::stage_instance_delete_t(ev))); + mQueue.enqueue(DpInternalEvent(DpEventID::StageInstanceDelete, new DpStageInstanceDeleteEvent(ev))); } // ------------------------------------------------------------------------------------------------ @@ -587,67 +587,67 @@ void DpInternalEvent::Release() // Identify data type switch (type) { - case DpEventID::VoiceStateUpdate: delete reinterpret_cast< uint8_t * >(data); break; + case DpEventID::VoiceStateUpdate: delete reinterpret_cast< DpVoiceStateUpdateEvent * >(data); break; case DpEventID::Log: delete reinterpret_cast< DpLogEvent * >(data); break; - case DpEventID::GuildJoinRequestDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::InteractionCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ButtonClick: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::SelectClick: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelUpdate: delete reinterpret_cast< uint8_t * >(data); break; + case DpEventID::GuildJoinRequestDelete: delete reinterpret_cast< DpGuildJoinRequestDeleteEvent * >(data); break; + case DpEventID::InteractionCreate: delete reinterpret_cast< DpInteractionCreateEvent * >(data); break; + case DpEventID::ButtonClick: delete reinterpret_cast< DpButtonClickEvent * >(data); break; + case DpEventID::SelectClick: delete reinterpret_cast< DpSelectClickEvent * >(data); break; + case DpEventID::GuildDelete: delete reinterpret_cast< DpGuildDeleteEvent * >(data); break; + case DpEventID::ChannelDelete: delete reinterpret_cast< DpChannelDeleteEvent * >(data); break; + case DpEventID::ChannelUpdate: delete reinterpret_cast< DpChannelUpdateEvent * >(data); break; case DpEventID::Ready: delete reinterpret_cast< DpReadyEvent * >(data); break; - case DpEventID::MessageDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ApplicationCommandDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMemberRemove: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ApplicationCommandCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::Resumed: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildRoleCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::TypingStart: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionAdd: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMembersChunk: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionRemove: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionRemoveEmoji: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageDeleteBulk: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildRoleUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildRoleDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelPinsUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionRemoveAll: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceServerUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildEmojisUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildStickersUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::PresenceUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::WebhooksUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMemberAdd: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::InviteDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildIntegrationsUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMemberUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ApplicationCommandUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::InviteCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::UserUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildBanAdd: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildBanRemove: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::IntegrationCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::IntegrationUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::IntegrationDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadDelete: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadListSync: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadMemberUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadMembersUpdate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceBufferSend: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceUserTalking: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceReady: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceReceive: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceTrackMarker: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::StageInstanceCreate: delete reinterpret_cast< uint8_t * >(data); break; - case DpEventID::StageInstanceDelete: delete reinterpret_cast< uint8_t * >(data); break; + case DpEventID::MessageDelete: delete reinterpret_cast< DpMessageDeleteEvent * >(data); break; + case DpEventID::ApplicationCommandDelete: delete reinterpret_cast< DpApplicationCommandDeleteEvent * >(data); break; + case DpEventID::GuildMemberRemove: delete reinterpret_cast< DpGuildMemberRemoveEvent * >(data); break; + case DpEventID::ApplicationCommandCreate: delete reinterpret_cast< DpApplicationCommandCreateEvent * >(data); break; + case DpEventID::Resumed: delete reinterpret_cast< DpResumedEvent * >(data); break; + case DpEventID::GuildRoleCreate: delete reinterpret_cast< DpGuildRoleCreateEvent * >(data); break; + case DpEventID::TypingStart: delete reinterpret_cast< DpTypingStartEvent * >(data); break; + case DpEventID::MessageReactionAdd: delete reinterpret_cast< DpMessageReactionAddEvent * >(data); break; + case DpEventID::GuildMembersChunk: delete reinterpret_cast< DpGuildMembersChunkEvent * >(data); break; + case DpEventID::MessageReactionRemove: delete reinterpret_cast< DpMessageReactionRemoveEvent * >(data); break; + case DpEventID::GuildCreate: delete reinterpret_cast< DpGuildCreateEvent * >(data); break; + case DpEventID::ChannelCreate: delete reinterpret_cast< DpChannelCreateEvent * >(data); break; + case DpEventID::MessageReactionRemoveEmoji: delete reinterpret_cast< DpMessageReactionRemoveEmojiEvent * >(data); break; + case DpEventID::MessageDeleteBulk: delete reinterpret_cast< DpMessageDeleteBulkEvent * >(data); break; + case DpEventID::GuildRoleUpdate: delete reinterpret_cast< DpGuildRoleUpdateEvent * >(data); break; + case DpEventID::GuildRoleDelete: delete reinterpret_cast< DpGuildRoleDeleteEvent * >(data); break; + case DpEventID::ChannelPinsUpdate: delete reinterpret_cast< DpChannelPinsUpdateEvent * >(data); break; + case DpEventID::MessageReactionRemoveAll: delete reinterpret_cast< DpMessageReactionRemoveAllEvent * >(data); break; + case DpEventID::VoiceServerUpdate: delete reinterpret_cast< DpVoiceServerUpdateEvent * >(data); break; + case DpEventID::GuildEmojisUpdate: delete reinterpret_cast< DpGuildEmojisUpdateEvent * >(data); break; + case DpEventID::GuildStickersUpdate: delete reinterpret_cast< DpGuildStickersUpdateEvent * >(data); break; + case DpEventID::PresenceUpdate: delete reinterpret_cast< DpPresenceUpdateEvent * >(data); break; + case DpEventID::WebhooksUpdate: delete reinterpret_cast< DpWebhooksUpdateEvent * >(data); break; + case DpEventID::GuildMemberAdd: delete reinterpret_cast< DpGuildMemberAddEvent * >(data); break; + case DpEventID::InviteDelete: delete reinterpret_cast< DpInviteDeleteEvent * >(data); break; + case DpEventID::GuildUpdate: delete reinterpret_cast< DpGuildUpdateEvent * >(data); break; + case DpEventID::GuildIntegrationsUpdate: delete reinterpret_cast< DpGuildIntegrationsUpdateEvent * >(data); break; + case DpEventID::GuildMemberUpdate: delete reinterpret_cast< DpGuildMemberUpdateEvent * >(data); break; + case DpEventID::ApplicationCommandUpdate: delete reinterpret_cast< DpApplicationCommandUpdateEvent * >(data); break; + case DpEventID::InviteCreate: delete reinterpret_cast< DpInviteCreateEvent * >(data); break; + case DpEventID::MessageUpdate: delete reinterpret_cast< DpMessageUpdateEvent * >(data); break; + case DpEventID::UserUpdate: delete reinterpret_cast< DpUserUpdateEvent * >(data); break; + case DpEventID::MessageCreate: delete reinterpret_cast< DpMessageCreateEvent * >(data); break; + case DpEventID::GuildBanAdd: delete reinterpret_cast< DpGuildBanAddEvent * >(data); break; + case DpEventID::GuildBanRemove: delete reinterpret_cast< DpGuildBanRemoveEvent * >(data); break; + case DpEventID::IntegrationCreate: delete reinterpret_cast< DpIntegrationCreateEvent * >(data); break; + case DpEventID::IntegrationUpdate: delete reinterpret_cast< DpIntegrationUpdateEvent * >(data); break; + case DpEventID::IntegrationDelete: delete reinterpret_cast< DpIntegrationDeleteEvent * >(data); break; + case DpEventID::ThreadCreate: delete reinterpret_cast< DpThreadCreateEvent * >(data); break; + case DpEventID::ThreadUpdate: delete reinterpret_cast< DpThreadUpdateEvent * >(data); break; + case DpEventID::ThreadDelete: delete reinterpret_cast< DpThreadDeleteEvent * >(data); break; + case DpEventID::ThreadListSync: delete reinterpret_cast< DpThreadListSyncEvent * >(data); break; + case DpEventID::ThreadMemberUpdate: delete reinterpret_cast< DpThreadMemberUpdateEvent * >(data); break; + case DpEventID::ThreadMembersUpdate: delete reinterpret_cast< DpThreadMembersUpdateEvent * >(data); break; + case DpEventID::VoiceBufferSend: delete reinterpret_cast< DpVoiceBufferSendEvent * >(data); break; + case DpEventID::VoiceUserTalking: delete reinterpret_cast< DpVoiceUserTalkingEvent * >(data); break; + case DpEventID::VoiceReady: delete reinterpret_cast< DpVoiceReadyEvent * >(data); break; + case DpEventID::VoiceReceive: delete reinterpret_cast< DpVoiceReceiveEvent * >(data); break; + case DpEventID::VoiceTrackMarker: delete reinterpret_cast< DpVoiceTrackMarkerEvent * >(data); break; + case DpEventID::StageInstanceCreate: delete reinterpret_cast< DpStageInstanceCreateEvent * >(data); break; + case DpEventID::StageInstanceDelete: delete reinterpret_cast< DpStageInstanceDeleteEvent * >(data); break; case DpEventID::Max: // Fall through default: LogFtl("Unrecognized discord event instance type"); assert(0); break; } @@ -660,67 +660,67 @@ SQMOD_NODISCARD LightObj EventToScriptObject(uint8_t type, uintptr_t data) { switch (type) { - case DpEventID::VoiceStateUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); + case DpEventID::VoiceStateUpdate: return LightObj(reinterpret_cast< DpVoiceStateUpdateEvent * >(data)); case DpEventID::Log: return LightObj(reinterpret_cast< DpLogEvent * >(data)); - case DpEventID::GuildJoinRequestDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::InteractionCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ButtonClick: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::SelectClick: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ChannelDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ChannelUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); + case DpEventID::GuildJoinRequestDelete: return LightObj(reinterpret_cast< DpGuildJoinRequestDeleteEvent * >(data)); + case DpEventID::InteractionCreate: return LightObj(reinterpret_cast< DpInteractionCreateEvent * >(data)); + case DpEventID::ButtonClick: return LightObj(reinterpret_cast< DpButtonClickEvent * >(data)); + case DpEventID::SelectClick: return LightObj(reinterpret_cast< DpSelectClickEvent * >(data)); + case DpEventID::GuildDelete: return LightObj(reinterpret_cast< DpGuildDeleteEvent * >(data)); + case DpEventID::ChannelDelete: return LightObj(reinterpret_cast< DpChannelDeleteEvent * >(data)); + case DpEventID::ChannelUpdate: return LightObj(reinterpret_cast< DpChannelUpdateEvent * >(data)); case DpEventID::Ready: return LightObj(reinterpret_cast< DpReadyEvent * >(data)); - case DpEventID::MessageDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ApplicationCommandDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildMemberRemove: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ApplicationCommandCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::Resumed: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildRoleCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::TypingStart: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::MessageReactionAdd: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildMembersChunk: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::MessageReactionRemove: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ChannelCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::MessageReactionRemoveEmoji: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::MessageDeleteBulk: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildRoleUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildRoleDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ChannelPinsUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::MessageReactionRemoveAll: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::VoiceServerUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildEmojisUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildStickersUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::PresenceUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::WebhooksUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildMemberAdd: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::InviteDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildIntegrationsUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildMemberUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ApplicationCommandUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::InviteCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::MessageUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::UserUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::MessageCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildBanAdd: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::GuildBanRemove: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::IntegrationCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::IntegrationUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::IntegrationDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ThreadCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ThreadUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ThreadDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ThreadListSync: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ThreadMemberUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::ThreadMembersUpdate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::VoiceBufferSend: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::VoiceUserTalking: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::VoiceReady: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::VoiceReceive: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::VoiceTrackMarker: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::StageInstanceCreate: return LightObj(reinterpret_cast< uint8_t * >(data)); - case DpEventID::StageInstanceDelete: return LightObj(reinterpret_cast< uint8_t * >(data)); + case DpEventID::MessageDelete: return LightObj(reinterpret_cast< DpMessageDeleteEvent * >(data)); + case DpEventID::ApplicationCommandDelete: return LightObj(reinterpret_cast< DpApplicationCommandDeleteEvent * >(data)); + case DpEventID::GuildMemberRemove: return LightObj(reinterpret_cast< DpGuildMemberRemoveEvent * >(data)); + case DpEventID::ApplicationCommandCreate: return LightObj(reinterpret_cast< DpApplicationCommandCreateEvent * >(data)); + case DpEventID::Resumed: return LightObj(reinterpret_cast< DpResumedEvent * >(data)); + case DpEventID::GuildRoleCreate: return LightObj(reinterpret_cast< DpGuildRoleCreateEvent * >(data)); + case DpEventID::TypingStart: return LightObj(reinterpret_cast< DpTypingStartEvent * >(data)); + case DpEventID::MessageReactionAdd: return LightObj(reinterpret_cast< DpMessageReactionAddEvent * >(data)); + case DpEventID::GuildMembersChunk: return LightObj(reinterpret_cast< DpGuildMembersChunkEvent * >(data)); + case DpEventID::MessageReactionRemove: return LightObj(reinterpret_cast< DpMessageReactionRemoveEvent * >(data)); + case DpEventID::GuildCreate: return LightObj(reinterpret_cast< DpGuildCreateEvent * >(data)); + case DpEventID::ChannelCreate: return LightObj(reinterpret_cast< DpChannelCreateEvent * >(data)); + case DpEventID::MessageReactionRemoveEmoji: return LightObj(reinterpret_cast< DpMessageReactionRemoveEmojiEvent * >(data)); + case DpEventID::MessageDeleteBulk: return LightObj(reinterpret_cast< DpMessageDeleteBulkEvent * >(data)); + case DpEventID::GuildRoleUpdate: return LightObj(reinterpret_cast< DpGuildRoleUpdateEvent * >(data)); + case DpEventID::GuildRoleDelete: return LightObj(reinterpret_cast< DpGuildRoleDeleteEvent * >(data)); + case DpEventID::ChannelPinsUpdate: return LightObj(reinterpret_cast< DpChannelPinsUpdateEvent * >(data)); + case DpEventID::MessageReactionRemoveAll: return LightObj(reinterpret_cast< DpMessageReactionRemoveAllEvent * >(data)); + case DpEventID::VoiceServerUpdate: return LightObj(reinterpret_cast< DpVoiceServerUpdateEvent * >(data)); + case DpEventID::GuildEmojisUpdate: return LightObj(reinterpret_cast< DpGuildEmojisUpdateEvent * >(data)); + case DpEventID::GuildStickersUpdate: return LightObj(reinterpret_cast< DpGuildStickersUpdateEvent * >(data)); + case DpEventID::PresenceUpdate: return LightObj(reinterpret_cast< DpPresenceUpdateEvent * >(data)); + case DpEventID::WebhooksUpdate: return LightObj(reinterpret_cast< DpWebhooksUpdateEvent * >(data)); + case DpEventID::GuildMemberAdd: return LightObj(reinterpret_cast< DpGuildMemberAddEvent * >(data)); + case DpEventID::InviteDelete: return LightObj(reinterpret_cast< DpInviteDeleteEvent * >(data)); + case DpEventID::GuildUpdate: return LightObj(reinterpret_cast< DpGuildUpdateEvent * >(data)); + case DpEventID::GuildIntegrationsUpdate: return LightObj(reinterpret_cast< DpGuildIntegrationsUpdateEvent * >(data)); + case DpEventID::GuildMemberUpdate: return LightObj(reinterpret_cast< DpGuildMemberUpdateEvent * >(data)); + case DpEventID::ApplicationCommandUpdate: return LightObj(reinterpret_cast< DpApplicationCommandUpdateEvent * >(data)); + case DpEventID::InviteCreate: return LightObj(reinterpret_cast< DpInviteCreateEvent * >(data)); + case DpEventID::MessageUpdate: return LightObj(reinterpret_cast< DpMessageUpdateEvent * >(data)); + case DpEventID::UserUpdate: return LightObj(reinterpret_cast< DpUserUpdateEvent * >(data)); + case DpEventID::MessageCreate: return LightObj(reinterpret_cast< DpMessageCreateEvent * >(data)); + case DpEventID::GuildBanAdd: return LightObj(reinterpret_cast< DpGuildBanAddEvent * >(data)); + case DpEventID::GuildBanRemove: return LightObj(reinterpret_cast< DpGuildBanRemoveEvent * >(data)); + case DpEventID::IntegrationCreate: return LightObj(reinterpret_cast< DpIntegrationCreateEvent * >(data)); + case DpEventID::IntegrationUpdate: return LightObj(reinterpret_cast< DpIntegrationUpdateEvent * >(data)); + case DpEventID::IntegrationDelete: return LightObj(reinterpret_cast< DpIntegrationDeleteEvent * >(data)); + case DpEventID::ThreadCreate: return LightObj(reinterpret_cast< DpThreadCreateEvent * >(data)); + case DpEventID::ThreadUpdate: return LightObj(reinterpret_cast< DpThreadUpdateEvent * >(data)); + case DpEventID::ThreadDelete: return LightObj(reinterpret_cast< DpThreadDeleteEvent * >(data)); + case DpEventID::ThreadListSync: return LightObj(reinterpret_cast< DpThreadListSyncEvent * >(data)); + case DpEventID::ThreadMemberUpdate: return LightObj(reinterpret_cast< DpThreadMemberUpdateEvent * >(data)); + case DpEventID::ThreadMembersUpdate: return LightObj(reinterpret_cast< DpThreadMembersUpdateEvent * >(data)); + case DpEventID::VoiceBufferSend: return LightObj(reinterpret_cast< DpVoiceBufferSendEvent * >(data)); + case DpEventID::VoiceUserTalking: return LightObj(reinterpret_cast< DpVoiceUserTalkingEvent * >(data)); + case DpEventID::VoiceReady: return LightObj(reinterpret_cast< DpVoiceReadyEvent * >(data)); + case DpEventID::VoiceReceive: return LightObj(reinterpret_cast< DpVoiceReceiveEvent * >(data)); + case DpEventID::VoiceTrackMarker: return LightObj(reinterpret_cast< DpVoiceTrackMarkerEvent * >(data)); + case DpEventID::StageInstanceCreate: return LightObj(reinterpret_cast< DpStageInstanceCreateEvent * >(data)); + case DpEventID::StageInstanceDelete: return LightObj(reinterpret_cast< DpStageInstanceDeleteEvent * >(data)); case DpEventID::Max: // Fall through default: assert(0); return LightObj{}; } @@ -731,67 +731,67 @@ void EventInvokeCleanup(uint8_t type, uintptr_t data) { switch (type) { - case DpEventID::VoiceStateUpdate: reinterpret_cast< uint8_t * >(data); break; + case DpEventID::VoiceStateUpdate: reinterpret_cast< DpVoiceStateUpdateEvent * >(data)->Cleanup(); break; case DpEventID::Log: reinterpret_cast< DpLogEvent * >(data)->Cleanup(); break; - case DpEventID::GuildJoinRequestDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::InteractionCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ButtonClick: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::SelectClick: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelUpdate: reinterpret_cast< uint8_t * >(data); break; + case DpEventID::GuildJoinRequestDelete: reinterpret_cast< DpGuildJoinRequestDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::InteractionCreate: reinterpret_cast< DpInteractionCreateEvent * >(data)->Cleanup(); break; + case DpEventID::ButtonClick: reinterpret_cast< DpButtonClickEvent * >(data)->Cleanup(); break; + case DpEventID::SelectClick: reinterpret_cast< DpSelectClickEvent * >(data)->Cleanup(); break; + case DpEventID::GuildDelete: reinterpret_cast< DpGuildDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::ChannelDelete: reinterpret_cast< DpChannelDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::ChannelUpdate: reinterpret_cast< DpChannelUpdateEvent * >(data)->Cleanup(); break; case DpEventID::Ready: reinterpret_cast< DpReadyEvent * >(data)->Cleanup(); break; - case DpEventID::MessageDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ApplicationCommandDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMemberRemove: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ApplicationCommandCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::Resumed: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildRoleCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::TypingStart: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionAdd: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMembersChunk: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionRemove: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionRemoveEmoji: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageDeleteBulk: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildRoleUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildRoleDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ChannelPinsUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageReactionRemoveAll: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceServerUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildEmojisUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildStickersUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::PresenceUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::WebhooksUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMemberAdd: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::InviteDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildIntegrationsUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildMemberUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ApplicationCommandUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::InviteCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::UserUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::MessageCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildBanAdd: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::GuildBanRemove: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::IntegrationCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::IntegrationUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::IntegrationDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadDelete: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadListSync: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadMemberUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::ThreadMembersUpdate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceBufferSend: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceUserTalking: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceReady: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceReceive: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::VoiceTrackMarker: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::StageInstanceCreate: reinterpret_cast< uint8_t * >(data); break; - case DpEventID::StageInstanceDelete: reinterpret_cast< uint8_t * >(data); break; + case DpEventID::MessageDelete: reinterpret_cast< DpMessageDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::ApplicationCommandDelete: reinterpret_cast< DpApplicationCommandDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::GuildMemberRemove: reinterpret_cast< DpGuildMemberRemoveEvent * >(data)->Cleanup(); break; + case DpEventID::ApplicationCommandCreate: reinterpret_cast< DpApplicationCommandCreateEvent * >(data)->Cleanup(); break; + case DpEventID::Resumed: reinterpret_cast< DpResumedEvent * >(data)->Cleanup(); break; + case DpEventID::GuildRoleCreate: reinterpret_cast< DpGuildRoleCreateEvent * >(data)->Cleanup(); break; + case DpEventID::TypingStart: reinterpret_cast< DpTypingStartEvent * >(data)->Cleanup(); break; + case DpEventID::MessageReactionAdd: reinterpret_cast< DpMessageReactionAddEvent * >(data)->Cleanup(); break; + case DpEventID::GuildMembersChunk: reinterpret_cast< DpGuildMembersChunkEvent * >(data)->Cleanup(); break; + case DpEventID::MessageReactionRemove: reinterpret_cast< DpMessageReactionRemoveEvent * >(data)->Cleanup(); break; + case DpEventID::GuildCreate: reinterpret_cast< DpGuildCreateEvent * >(data)->Cleanup(); break; + case DpEventID::ChannelCreate: reinterpret_cast< DpChannelCreateEvent * >(data)->Cleanup(); break; + case DpEventID::MessageReactionRemoveEmoji: reinterpret_cast< DpMessageReactionRemoveEmojiEvent * >(data)->Cleanup(); break; + case DpEventID::MessageDeleteBulk: reinterpret_cast< DpMessageDeleteBulkEvent * >(data)->Cleanup(); break; + case DpEventID::GuildRoleUpdate: reinterpret_cast< DpGuildRoleUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::GuildRoleDelete: reinterpret_cast< DpGuildRoleDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::ChannelPinsUpdate: reinterpret_cast< DpChannelPinsUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::MessageReactionRemoveAll: reinterpret_cast< DpMessageReactionRemoveAllEvent * >(data)->Cleanup(); break; + case DpEventID::VoiceServerUpdate: reinterpret_cast< DpVoiceServerUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::GuildEmojisUpdate: reinterpret_cast< DpGuildEmojisUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::GuildStickersUpdate: reinterpret_cast< DpGuildStickersUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::PresenceUpdate: reinterpret_cast< DpPresenceUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::WebhooksUpdate: reinterpret_cast< DpWebhooksUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::GuildMemberAdd: reinterpret_cast< DpGuildMemberAddEvent * >(data)->Cleanup(); break; + case DpEventID::InviteDelete: reinterpret_cast< DpInviteDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::GuildUpdate: reinterpret_cast< DpGuildUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::GuildIntegrationsUpdate: reinterpret_cast< DpGuildIntegrationsUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::GuildMemberUpdate: reinterpret_cast< DpGuildMemberUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::ApplicationCommandUpdate: reinterpret_cast< DpApplicationCommandUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::InviteCreate: reinterpret_cast< DpInviteCreateEvent * >(data)->Cleanup(); break; + case DpEventID::MessageUpdate: reinterpret_cast< DpMessageUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::UserUpdate: reinterpret_cast< DpUserUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::MessageCreate: reinterpret_cast< DpMessageCreateEvent * >(data)->Cleanup(); break; + case DpEventID::GuildBanAdd: reinterpret_cast< DpGuildBanAddEvent * >(data)->Cleanup(); break; + case DpEventID::GuildBanRemove: reinterpret_cast< DpGuildBanRemoveEvent * >(data)->Cleanup(); break; + case DpEventID::IntegrationCreate: reinterpret_cast< DpIntegrationCreateEvent * >(data)->Cleanup(); break; + case DpEventID::IntegrationUpdate: reinterpret_cast< DpIntegrationUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::IntegrationDelete: reinterpret_cast< DpIntegrationDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::ThreadCreate: reinterpret_cast< DpThreadCreateEvent * >(data)->Cleanup(); break; + case DpEventID::ThreadUpdate: reinterpret_cast< DpThreadUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::ThreadDelete: reinterpret_cast< DpThreadDeleteEvent * >(data)->Cleanup(); break; + case DpEventID::ThreadListSync: reinterpret_cast< DpThreadListSyncEvent * >(data)->Cleanup(); break; + case DpEventID::ThreadMemberUpdate: reinterpret_cast< DpThreadMemberUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::ThreadMembersUpdate: reinterpret_cast< DpThreadMembersUpdateEvent * >(data)->Cleanup(); break; + case DpEventID::VoiceBufferSend: reinterpret_cast< DpVoiceBufferSendEvent * >(data)->Cleanup(); break; + case DpEventID::VoiceUserTalking: reinterpret_cast< DpVoiceUserTalkingEvent * >(data)->Cleanup(); break; + case DpEventID::VoiceReady: reinterpret_cast< DpVoiceReadyEvent * >(data)->Cleanup(); break; + case DpEventID::VoiceReceive: reinterpret_cast< DpVoiceReceiveEvent * >(data)->Cleanup(); break; + case DpEventID::VoiceTrackMarker: reinterpret_cast< DpVoiceTrackMarkerEvent * >(data)->Cleanup(); break; + case DpEventID::StageInstanceCreate: reinterpret_cast< DpStageInstanceCreateEvent * >(data)->Cleanup(); break; + case DpEventID::StageInstanceDelete: reinterpret_cast< DpStageInstanceDeleteEvent * >(data)->Cleanup(); break; case DpEventID::Max: // Fall through default: assert(0); return; } diff --git a/module/Library/DPPEv.cpp b/module/Library/DPPEv.cpp index 26981863..a3703106 100644 --- a/module/Library/DPPEv.cpp +++ b/module/Library/DPPEv.cpp @@ -11,10 +11,67 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ -SQMOD_DECL_TYPENAME(SqDppVoiceStateUpdateEventEvent, _SC("SqDppVoiceStateUpdateEventEvent")) -SQMOD_DECL_TYPENAME(SqDppGuildJoinRequestDeleteEvent, _SC("SqDppGuildJoinRequestDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppVoiceStateUpdateEvent, _SC("SqDppVoiceStateUpdateEvent")) SQMOD_DECL_TYPENAME(SqDppLogEvent, _SC("SqDppLogEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildJoinRequestDeleteEvent, _SC("SqDppGuildJoinRequestDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppInteractionCreateEvent, _SC("SqDppInteractionCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppButtonClickEvent, _SC("SqDppButtonClickEvent")) +SQMOD_DECL_TYPENAME(SqDppSelectClickEvent, _SC("SqDppSelectClickEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildDeleteEvent, _SC("SqDppGuildDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppChannelDeleteEvent, _SC("SqDppChannelDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppChannelUpdateEvent, _SC("SqDppChannelUpdateEvent")) SQMOD_DECL_TYPENAME(SqDppReadyEvent, _SC("SqDppReadyEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageDeleteEvent, _SC("SqDppMessageDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppApplicationCommandDeleteEvent, _SC("SqDppApplicationCommandDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildMemberRemoveEvent, _SC("SqDppGuildMemberRemoveEvent")) +SQMOD_DECL_TYPENAME(SqDppApplicationCommandCreateEvent, _SC("SqDppApplicationCommandCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppResumedEvent, _SC("SqDppResumedEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildRoleCreateEvent, _SC("SqDppGuildRoleCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppTypingStartEvent, _SC("SqDppTypingStartEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageReactionAddEvent, _SC("SqDppMessageReactionAddEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildMembersChunkEvent, _SC("SqDppGuildMembersChunkEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageReactionRemoveEvent, _SC("SqDppMessageReactionRemoveEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildCreateEvent, _SC("SqDppGuildCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppChannelCreateEvent, _SC("SqDppChannelCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageReactionRemoveEmojiEvent, _SC("SqDppMessageReactionRemoveEmojiEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageDeleteBulkEvent, _SC("SqDppMessageDeleteBulkEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildRoleUpdateEvent, _SC("SqDppGuildRoleUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildRoleDeleteEvent, _SC("SqDppGuildRoleDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppChannelPinsUpdateEvent, _SC("SqDppChannelPinsUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageReactionRemoveAllEvent, _SC("SqDppMessageReactionRemoveAllEvent")) +SQMOD_DECL_TYPENAME(SqDppVoiceServerUpdateEvent, _SC("SqDppVoiceServerUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildEmojisUpdateEvent, _SC("SqDppGuildEmojisUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildStickersUpdateEvent, _SC("SqDppGuildStickersUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppPresenceUpdateEvent, _SC("SqDppPresenceUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppWebhooksUpdateEvent, _SC("SqDppWebhooksUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildMemberAddEvent, _SC("SqDppGuildMemberAddEvent")) +SQMOD_DECL_TYPENAME(SqDppInviteDeleteEvent, _SC("SqDppInviteDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildUpdateEvent, _SC("SqDppGuildUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildIntegrationsUpdateEvent, _SC("SqDppGuildIntegrationsUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildMemberUpdateEvent, _SC("SqDppGuildMemberUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppApplicationCommandUpdateEvent, _SC("SqDppApplicationCommandUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppInviteCreateEvent, _SC("SqDppInviteCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageUpdateEvent, _SC("SqDppMessageUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppUserUpdateEvent, _SC("SqDppUserUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppMessageCreateEvent, _SC("SqDppMessageCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildBanAddEvent, _SC("SqDppGuildBanAddEvent")) +SQMOD_DECL_TYPENAME(SqDppGuildBanRemoveEvent, _SC("SqDppGuildBanRemoveEvent")) +SQMOD_DECL_TYPENAME(SqDppIntegrationCreateEvent, _SC("SqDppIntegrationCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppIntegrationUpdateEvent, _SC("SqDppIntegrationUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppIntegrationDeleteEvent, _SC("SqDppIntegrationDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppThreadCreateEvent, _SC("SqDppThreadCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppThreadUpdateEvent, _SC("SqDppThreadUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppThreadDeleteEvent, _SC("SqDppThreadDeleteEvent")) +SQMOD_DECL_TYPENAME(SqDppThreadListSyncEvent, _SC("SqDppThreadListSyncEvent")) +SQMOD_DECL_TYPENAME(SqDppThreadMemberUpdateEvent, _SC("SqDppThreadMemberUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppThreadMembersUpdateEvent, _SC("SqDppThreadMembersUpdateEvent")) +SQMOD_DECL_TYPENAME(SqDppVoiceBufferSendEvent, _SC("SqDppVoiceBufferSendEvent")) +SQMOD_DECL_TYPENAME(SqDppVoiceUserTalkingEvent, _SC("SqDppVoiceUserTalkingEvent")) +SQMOD_DECL_TYPENAME(SqDppVoiceReadyEvent, _SC("SqDppVoiceReadyEvent")) +SQMOD_DECL_TYPENAME(SqDppVoiceReceiveEvent, _SC("SqDppVoiceReceiveEvent")) +SQMOD_DECL_TYPENAME(SqDppVoiceTrackMarkerEvent, _SC("SqDppVoiceTrackMarkerEvent")) +SQMOD_DECL_TYPENAME(SqDppStageInstanceCreateEvent, _SC("SqDppStageInstanceCreateEvent")) +SQMOD_DECL_TYPENAME(SqDppStageInstanceDeleteEvent, _SC("SqDppStageInstanceDeleteEvent")) // ------------------------------------------------------------------------------------------------ const std::array< const char *, static_cast< size_t >(DpEventID::Max) > DpEventID::NAME{ @@ -86,9 +143,9 @@ void Register_DPPEv(HSQUIRRELVM vm, Table & ns) { // -------------------------------------------------------------------------------------------- ns.Bind(_SC("VoiceStateUpdate"), - Class< DpVoiceStateUpdateEvent, NoConstructor< DpVoiceStateUpdateEvent > >(vm, SqDppVoiceStateUpdateEventEvent::Str) + Class< DpVoiceStateUpdateEvent, NoConstructor< DpVoiceStateUpdateEvent > >(vm, SqDppVoiceStateUpdateEvent::Str) // Meta-methods - .SquirrelFunc(_SC("_typename"), &SqDppVoiceStateUpdateEventEvent::Fn) + .SquirrelFunc(_SC("_typename"), &SqDppVoiceStateUpdateEvent::Fn) .Func(_SC("_tostring"), &DpVoiceStateUpdateEvent::GetRawEvent) // Member Properties .Prop(_SC("State"), &DpVoiceStateUpdateEvent::GetState) @@ -105,6 +162,71 @@ void Register_DPPEv(HSQUIRRELVM vm, Table & ns) .Prop(_SC("Message"), &DpLogEvent::GetMessage) ); // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildJoinRequestDelete"), + Class< DpGuildJoinRequestDeleteEvent, NoConstructor< DpGuildJoinRequestDeleteEvent > >(vm, SqDppGuildJoinRequestDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildJoinRequestDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpGuildJoinRequestDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildJoinRequestDeleteEvent::GetRawEvent) + .Prop(_SC("GuildID"), &DpGuildJoinRequestDeleteEvent::GetGuildID) + .Prop(_SC("UserID"), &DpGuildJoinRequestDeleteEvent::GetUserID) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("InteractionCreate"), + Class< DpInteractionCreateEvent, NoConstructor< DpInteractionCreateEvent > >(vm, SqDppInteractionCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppInteractionCreateEvent::Fn) + .Func(_SC("_tostring"), &DpInteractionCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpInteractionCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ButtonClick"), + Class< DpButtonClickEvent, NoConstructor< DpButtonClickEvent > >(vm, SqDppButtonClickEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppButtonClickEvent::Fn) + .Func(_SC("_tostring"), &DpButtonClickEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpButtonClickEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("SelectClick"), + Class< DpSelectClickEvent, NoConstructor< DpSelectClickEvent > >(vm, SqDppSelectClickEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppSelectClickEvent::Fn) + .Func(_SC("_tostring"), &DpSelectClickEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpSelectClickEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildDelete"), + Class< DpGuildDeleteEvent, NoConstructor< DpGuildDeleteEvent > >(vm, SqDppGuildDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpGuildDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ChannelDelete"), + Class< DpChannelDeleteEvent, NoConstructor< DpChannelDeleteEvent > >(vm, SqDppChannelDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppChannelDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpChannelDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpChannelDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ChannelUpdate"), + Class< DpChannelUpdateEvent, NoConstructor< DpChannelUpdateEvent > >(vm, SqDppChannelUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppChannelUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpChannelUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpChannelUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- ns.Bind(_SC("Ready"), Class< DpReadyEvent, NoConstructor< DpReadyEvent > >(vm, SqDppReadyEvent::Str) // Meta-methods @@ -116,15 +238,463 @@ void Register_DPPEv(HSQUIRRELVM vm, Table & ns) .Prop(_SC("ShardID"), &DpReadyEvent::GetShardID) ); // -------------------------------------------------------------------------------------------- - ns.Bind(_SC("GuildJoinRequestDelete"), - Class< DpGuildJoinRequestDeleteEvent, NoConstructor< DpGuildJoinRequestDeleteEvent > >(vm, SqDppGuildJoinRequestDeleteEvent::Str) + ns.Bind(_SC("MessageDelete"), + Class< DpMessageDeleteEvent, NoConstructor< DpMessageDeleteEvent > >(vm, SqDppMessageDeleteEvent::Str) // Meta-methods - .SquirrelFunc(_SC("_typename"), &SqDppGuildJoinRequestDeleteEvent::Fn) - .Func(_SC("_tostring"), &DpGuildJoinRequestDeleteEvent::GetRawEvent) + .SquirrelFunc(_SC("_typename"), &SqDppMessageDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpMessageDeleteEvent::GetRawEvent) // Member Properties - .Prop(_SC("RawEvent"), &DpGuildJoinRequestDeleteEvent::GetRawEvent) - .Prop(_SC("GuildID"), &DpGuildJoinRequestDeleteEvent::GetGuildID) - .Prop(_SC("UserID"), &DpGuildJoinRequestDeleteEvent::GetUserID) + .Prop(_SC("RawEvent"), &DpMessageDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ApplicationCommandDelete"), + Class< DpApplicationCommandDeleteEvent, NoConstructor< DpApplicationCommandDeleteEvent > >(vm, SqDppApplicationCommandDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppApplicationCommandDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpApplicationCommandDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpApplicationCommandDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildMemberRemove"), + Class< DpGuildMemberRemoveEvent, NoConstructor< DpGuildMemberRemoveEvent > >(vm, SqDppGuildMemberRemoveEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildMemberRemoveEvent::Fn) + .Func(_SC("_tostring"), &DpGuildMemberRemoveEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildMemberRemoveEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ApplicationCommandCreate"), + Class< DpApplicationCommandCreateEvent, NoConstructor< DpApplicationCommandCreateEvent > >(vm, SqDppApplicationCommandCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppApplicationCommandCreateEvent::Fn) + .Func(_SC("_tostring"), &DpApplicationCommandCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpApplicationCommandCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("Resumed"), + Class< DpResumedEvent, NoConstructor< DpResumedEvent > >(vm, SqDppResumedEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppResumedEvent::Fn) + .Func(_SC("_tostring"), &DpResumedEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpResumedEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildRoleCreate"), + Class< DpGuildRoleCreateEvent, NoConstructor< DpGuildRoleCreateEvent > >(vm, SqDppGuildRoleCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildRoleCreateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildRoleCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildRoleCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("TypingStart"), + Class< DpTypingStartEvent, NoConstructor< DpTypingStartEvent > >(vm, SqDppTypingStartEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppTypingStartEvent::Fn) + .Func(_SC("_tostring"), &DpTypingStartEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpTypingStartEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("MessageReactionAdd"), + Class< DpMessageReactionAddEvent, NoConstructor< DpMessageReactionAddEvent > >(vm, SqDppMessageReactionAddEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppMessageReactionAddEvent::Fn) + .Func(_SC("_tostring"), &DpMessageReactionAddEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpMessageReactionAddEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildMembersChunk"), + Class< DpGuildMembersChunkEvent, NoConstructor< DpGuildMembersChunkEvent > >(vm, SqDppGuildMembersChunkEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildMembersChunkEvent::Fn) + .Func(_SC("_tostring"), &DpGuildMembersChunkEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildMembersChunkEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("MessageReactionRemove"), + Class< DpMessageReactionRemoveEvent, NoConstructor< DpMessageReactionRemoveEvent > >(vm, SqDppMessageReactionRemoveEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppMessageReactionRemoveEvent::Fn) + .Func(_SC("_tostring"), &DpMessageReactionRemoveEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpMessageReactionRemoveEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildCreate"), + Class< DpGuildCreateEvent, NoConstructor< DpGuildCreateEvent > >(vm, SqDppGuildCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildCreateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ChannelCreate"), + Class< DpChannelCreateEvent, NoConstructor< DpChannelCreateEvent > >(vm, SqDppChannelCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppChannelCreateEvent::Fn) + .Func(_SC("_tostring"), &DpChannelCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpChannelCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("MessageReactionRemoveEmoji"), + Class< DpMessageReactionRemoveEmojiEvent, NoConstructor< DpMessageReactionRemoveEmojiEvent > >(vm, SqDppMessageReactionRemoveEmojiEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppMessageReactionRemoveEmojiEvent::Fn) + .Func(_SC("_tostring"), &DpMessageReactionRemoveEmojiEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpMessageReactionRemoveEmojiEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("MessageDeleteBulk"), + Class< DpMessageDeleteBulkEvent, NoConstructor< DpMessageDeleteBulkEvent > >(vm, SqDppMessageDeleteBulkEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppMessageDeleteBulkEvent::Fn) + .Func(_SC("_tostring"), &DpMessageDeleteBulkEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpMessageDeleteBulkEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildRoleUpdate"), + Class< DpGuildRoleUpdateEvent, NoConstructor< DpGuildRoleUpdateEvent > >(vm, SqDppGuildRoleUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildRoleUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildRoleUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildRoleUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildRoleDelete"), + Class< DpGuildRoleDeleteEvent, NoConstructor< DpGuildRoleDeleteEvent > >(vm, SqDppGuildRoleDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildRoleDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpGuildRoleDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildRoleDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ChannelPinsUpdate"), + Class< DpChannelPinsUpdateEvent, NoConstructor< DpChannelPinsUpdateEvent > >(vm, SqDppChannelPinsUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppChannelPinsUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpChannelPinsUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpChannelPinsUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("MessageReactionRemoveAll"), + Class< DpMessageReactionRemoveAllEvent, NoConstructor< DpMessageReactionRemoveAllEvent > >(vm, SqDppMessageReactionRemoveAllEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppMessageReactionRemoveAllEvent::Fn) + .Func(_SC("_tostring"), &DpMessageReactionRemoveAllEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpMessageReactionRemoveAllEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("VoiceServerUpdate"), + Class< DpVoiceServerUpdateEvent, NoConstructor< DpVoiceServerUpdateEvent > >(vm, SqDppVoiceServerUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppVoiceServerUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpVoiceServerUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpVoiceServerUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildEmojisUpdate"), + Class< DpGuildEmojisUpdateEvent, NoConstructor< DpGuildEmojisUpdateEvent > >(vm, SqDppGuildEmojisUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildEmojisUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildEmojisUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildEmojisUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildStickersUpdate"), + Class< DpGuildStickersUpdateEvent, NoConstructor< DpGuildStickersUpdateEvent > >(vm, SqDppGuildStickersUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildStickersUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildStickersUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildStickersUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("PresenceUpdate"), + Class< DpPresenceUpdateEvent, NoConstructor< DpPresenceUpdateEvent > >(vm, SqDppPresenceUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppPresenceUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpPresenceUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpPresenceUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("WebhooksUpdate"), + Class< DpWebhooksUpdateEvent, NoConstructor< DpWebhooksUpdateEvent > >(vm, SqDppWebhooksUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppWebhooksUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpWebhooksUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpWebhooksUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildMemberAdd"), + Class< DpGuildMemberAddEvent, NoConstructor< DpGuildMemberAddEvent > >(vm, SqDppGuildMemberAddEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildMemberAddEvent::Fn) + .Func(_SC("_tostring"), &DpGuildMemberAddEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildMemberAddEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("InviteDelete"), + Class< DpInviteDeleteEvent, NoConstructor< DpInviteDeleteEvent > >(vm, SqDppInviteDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppInviteDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpInviteDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpInviteDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildUpdate"), + Class< DpGuildUpdateEvent, NoConstructor< DpGuildUpdateEvent > >(vm, SqDppGuildUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildIntegrationsUpdate"), + Class< DpGuildIntegrationsUpdateEvent, NoConstructor< DpGuildIntegrationsUpdateEvent > >(vm, SqDppGuildIntegrationsUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildIntegrationsUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildIntegrationsUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildIntegrationsUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildMemberUpdate"), + Class< DpGuildMemberUpdateEvent, NoConstructor< DpGuildMemberUpdateEvent > >(vm, SqDppGuildMemberUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildMemberUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpGuildMemberUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildMemberUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ApplicationCommandUpdate"), + Class< DpApplicationCommandUpdateEvent, NoConstructor< DpApplicationCommandUpdateEvent > >(vm, SqDppApplicationCommandUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppApplicationCommandUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpApplicationCommandUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpApplicationCommandUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("InviteCreate"), + Class< DpInviteCreateEvent, NoConstructor< DpInviteCreateEvent > >(vm, SqDppInviteCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppInviteCreateEvent::Fn) + .Func(_SC("_tostring"), &DpInviteCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpInviteCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("MessageUpdate"), + Class< DpMessageUpdateEvent, NoConstructor< DpMessageUpdateEvent > >(vm, SqDppMessageUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppMessageUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpMessageUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpMessageUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("UserUpdate"), + Class< DpUserUpdateEvent, NoConstructor< DpUserUpdateEvent > >(vm, SqDppUserUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppUserUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpUserUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpUserUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("MessageCreate"), + Class< DpMessageCreateEvent, NoConstructor< DpMessageCreateEvent > >(vm, SqDppMessageCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppMessageCreateEvent::Fn) + .Func(_SC("_tostring"), &DpMessageCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpMessageCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildBanAdd"), + Class< DpGuildBanAddEvent, NoConstructor< DpGuildBanAddEvent > >(vm, SqDppGuildBanAddEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildBanAddEvent::Fn) + .Func(_SC("_tostring"), &DpGuildBanAddEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildBanAddEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("GuildBanRemove"), + Class< DpGuildBanRemoveEvent, NoConstructor< DpGuildBanRemoveEvent > >(vm, SqDppGuildBanRemoveEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppGuildBanRemoveEvent::Fn) + .Func(_SC("_tostring"), &DpGuildBanRemoveEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpGuildBanRemoveEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("IntegrationCreate"), + Class< DpIntegrationCreateEvent, NoConstructor< DpIntegrationCreateEvent > >(vm, SqDppIntegrationCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppIntegrationCreateEvent::Fn) + .Func(_SC("_tostring"), &DpIntegrationCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpIntegrationCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("IntegrationUpdate"), + Class< DpIntegrationUpdateEvent, NoConstructor< DpIntegrationUpdateEvent > >(vm, SqDppIntegrationUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppIntegrationUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpIntegrationUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpIntegrationUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("IntegrationDelete"), + Class< DpIntegrationDeleteEvent, NoConstructor< DpIntegrationDeleteEvent > >(vm, SqDppIntegrationDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppIntegrationDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpIntegrationDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpIntegrationDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ThreadCreate"), + Class< DpThreadCreateEvent, NoConstructor< DpThreadCreateEvent > >(vm, SqDppThreadCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppThreadCreateEvent::Fn) + .Func(_SC("_tostring"), &DpThreadCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpThreadCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ThreadUpdate"), + Class< DpThreadUpdateEvent, NoConstructor< DpThreadUpdateEvent > >(vm, SqDppThreadUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppThreadUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpThreadUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpThreadUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ThreadDelete"), + Class< DpThreadDeleteEvent, NoConstructor< DpThreadDeleteEvent > >(vm, SqDppThreadDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppThreadDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpThreadDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpThreadDeleteEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ThreadListSync"), + Class< DpThreadListSyncEvent, NoConstructor< DpThreadListSyncEvent > >(vm, SqDppThreadListSyncEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppThreadListSyncEvent::Fn) + .Func(_SC("_tostring"), &DpThreadListSyncEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpThreadListSyncEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ThreadMemberUpdate"), + Class< DpThreadMemberUpdateEvent, NoConstructor< DpThreadMemberUpdateEvent > >(vm, SqDppThreadMemberUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppThreadMemberUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpThreadMemberUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpThreadMemberUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("ThreadMembersUpdate"), + Class< DpThreadMembersUpdateEvent, NoConstructor< DpThreadMembersUpdateEvent > >(vm, SqDppThreadMembersUpdateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppThreadMembersUpdateEvent::Fn) + .Func(_SC("_tostring"), &DpThreadMembersUpdateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpThreadMembersUpdateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("VoiceBufferSend"), + Class< DpVoiceBufferSendEvent, NoConstructor< DpVoiceBufferSendEvent > >(vm, SqDppVoiceBufferSendEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppVoiceBufferSendEvent::Fn) + .Func(_SC("_tostring"), &DpVoiceBufferSendEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpVoiceBufferSendEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("VoiceUserTalking"), + Class< DpVoiceUserTalkingEvent, NoConstructor< DpVoiceUserTalkingEvent > >(vm, SqDppVoiceUserTalkingEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppVoiceUserTalkingEvent::Fn) + .Func(_SC("_tostring"), &DpVoiceUserTalkingEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpVoiceUserTalkingEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("VoiceReady"), + Class< DpVoiceReadyEvent, NoConstructor< DpVoiceReadyEvent > >(vm, SqDppVoiceReadyEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppVoiceReadyEvent::Fn) + .Func(_SC("_tostring"), &DpVoiceReadyEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpVoiceReadyEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("VoiceReceive"), + Class< DpVoiceReceiveEvent, NoConstructor< DpVoiceReceiveEvent > >(vm, SqDppVoiceReceiveEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppVoiceReceiveEvent::Fn) + .Func(_SC("_tostring"), &DpVoiceReceiveEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpVoiceReceiveEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("VoiceTrackMarker"), + Class< DpVoiceTrackMarkerEvent, NoConstructor< DpVoiceTrackMarkerEvent > >(vm, SqDppVoiceTrackMarkerEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppVoiceTrackMarkerEvent::Fn) + .Func(_SC("_tostring"), &DpVoiceTrackMarkerEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpVoiceTrackMarkerEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("StageInstanceCreate"), + Class< DpStageInstanceCreateEvent, NoConstructor< DpStageInstanceCreateEvent > >(vm, SqDppStageInstanceCreateEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppStageInstanceCreateEvent::Fn) + .Func(_SC("_tostring"), &DpStageInstanceCreateEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpStageInstanceCreateEvent::GetRawEvent) + ); + // -------------------------------------------------------------------------------------------- + ns.Bind(_SC("StageInstanceDelete"), + Class< DpStageInstanceDeleteEvent, NoConstructor< DpStageInstanceDeleteEvent > >(vm, SqDppStageInstanceDeleteEvent::Str) + // Meta-methods + .SquirrelFunc(_SC("_typename"), &SqDppStageInstanceDeleteEvent::Fn) + .Func(_SC("_tostring"), &DpStageInstanceDeleteEvent::GetRawEvent) + // Member Properties + .Prop(_SC("RawEvent"), &DpStageInstanceDeleteEvent::GetRawEvent) ); // -------------------------------------------------------------------------------------------- ConstTable(vm).Enum(_SC("SqDiscordEvent"), Enumeration(vm) diff --git a/module/Library/DPPEv.hpp b/module/Library/DPPEv.hpp index 2ec213bd..2611d5de 100644 --- a/module/Library/DPPEv.hpp +++ b/module/Library/DPPEv.hpp @@ -101,50 +101,40 @@ struct DpEventBase * Raw event text. */ std::string mRaw{}; - /* -------------------------------------------------------------------------------------------- * Shard the event came from. */ dpp::discord_client * mFrom{nullptr}; - /* -------------------------------------------------------------------------------------------- * Default constructor. */ DpEventBase() noexcept = default; - /* -------------------------------------------------------------------------------------------- * Explicit constructor. */ explicit DpEventBase(const dpp::event_dispatch_t & d) noexcept : mRaw(d.raw_event), mFrom(d.from) - { - } - + { } /* -------------------------------------------------------------------------------------------- * Copy constructor (disabled). */ DpEventBase(const DpEventBase &) noexcept = delete; - /* -------------------------------------------------------------------------------------------- * Move constructor (disabled). */ DpEventBase(DpEventBase &&) noexcept = delete; - /* -------------------------------------------------------------------------------------------- * Destructor. */ virtual ~DpEventBase() noexcept = default; - /* -------------------------------------------------------------------------------------------- * Copy assignment operator (disabled). */ DpEventBase & operator = (const DpEventBase &) noexcept = delete; - /* -------------------------------------------------------------------------------------------- * Move assignment operator (disabled). */ DpEventBase & operator = (DpEventBase &&) noexcept = delete; - /* -------------------------------------------------------------------------------------------- * Cleanup after the event was processed. */ @@ -161,23 +151,18 @@ struct DpVoiceStateUpdateEvent : public DpEventBase { // -------------------------------------------------------------------------------------------- dpp::voicestate mState{}; - // -------------------------------------------------------------------------------------------- LightObj mSqState{}; - /* -------------------------------------------------------------------------------------------- * Explicit constructor. */ explicit DpVoiceStateUpdateEvent(const dpp::voice_state_update_t & d) noexcept : DpEventBase(d), mState(d.state), mSqState() - { - } - + { } /* -------------------------------------------------------------------------------------------- * Validate the managed handle. */ void Validate() const { if (!mFrom) STHROWF("Invalid discord [Ready] event handle"); } - /* -------------------------------------------------------------------------------------------- * Validate the managed handle and retrieve a reference to it. */ @@ -187,7 +172,6 @@ struct DpVoiceStateUpdateEvent : public DpEventBase * Validate the managed handle and retrieve a const reference to it. */ SQMOD_NODISCARD const DpVoiceStateUpdateEvent & Valid() const { Validate(); return *this; } - /* -------------------------------------------------------------------------------------------- * Cleanup after the event was processed. */ @@ -202,12 +186,10 @@ struct DpVoiceStateUpdateEvent : public DpEventBase // Allow the base to cleanup as well DpEventBase::Cleanup(); } - /* -------------------------------------------------------------------------------------------- * Retrieve the raw event. */ SQMOD_NODISCARD const std::string & GetRawEvent() const { return mRaw; } - /* -------------------------------------------------------------------------------------------- * Retrieve the voice state. */ @@ -222,63 +204,6 @@ struct DpVoiceStateUpdateEvent : public DpEventBase } }; -/* ------------------------------------------------------------------------------------------------ - * Guild join request delete (user declined membership screening) event. -*/ -struct DpGuildJoinRequestDeleteEvent : public DpEventBase -{ - // -------------------------------------------------------------------------------------------- - dpp::snowflake mGuildID{}; - dpp::snowflake mUserID{}; - - /* -------------------------------------------------------------------------------------------- - * Explicit constructor. - */ - explicit DpGuildJoinRequestDeleteEvent(const dpp::guild_join_request_delete_t & d) noexcept - : DpEventBase(d), mGuildID(d.guild_id), mUserID(d.user_id) - { - } - - /* -------------------------------------------------------------------------------------------- - * Validate the managed handle. - */ - void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildJoinRequestDelete] event handle"); } - - /* -------------------------------------------------------------------------------------------- - * Validate the managed handle and retrieve a reference to it. - */ - SQMOD_NODISCARD DpGuildJoinRequestDeleteEvent & Valid() { Validate(); return *this; } - - /* -------------------------------------------------------------------------------------------- - * Validate the managed handle and retrieve a const reference to it. - */ - SQMOD_NODISCARD const DpGuildJoinRequestDeleteEvent & Valid() const { Validate(); return *this; } - - /* -------------------------------------------------------------------------------------------- - * Cleanup after the event was processed. - */ - void Cleanup() override - { - // Allow the base to cleanup as well - DpEventBase::Cleanup(); - } - - /* -------------------------------------------------------------------------------------------- - * Retrieve the raw event. - */ - SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } - - /* -------------------------------------------------------------------------------------------- - * Retrieve the guild id. - */ - SQMOD_NODISCARD dpp::snowflake GetGuildID() const { return Valid().mGuildID; } - - /* -------------------------------------------------------------------------------------------- - * Retrieve the user id. - */ - SQMOD_NODISCARD dpp::snowflake GetUserID() const { return Valid().mUserID; } -}; - /* ------------------------------------------------------------------------------------------------ * Log message event. */ @@ -287,7 +212,6 @@ struct DpLogEvent : public DpEventBase // -------------------------------------------------------------------------------------------- SQInteger mSeverity{0}; std::string mMessage{}; - /* -------------------------------------------------------------------------------------------- * Explicit constructor. */ @@ -295,7 +219,6 @@ struct DpLogEvent : public DpEventBase : DpEventBase(d), mSeverity(d.severity), mMessage(d.message) { } - /* -------------------------------------------------------------------------------------------- * Cleanup after the event was processed. */ @@ -304,23 +227,308 @@ struct DpLogEvent : public DpEventBase // Allow the base to cleanup as well DpEventBase::Cleanup(); } - /* -------------------------------------------------------------------------------------------- * Retrieve the raw event. */ SQMOD_NODISCARD const std::string & GetRawEvent() const { return mRaw; } - /* -------------------------------------------------------------------------------------------- * Retrieve log severity. */ SQMOD_NODISCARD SQInteger GetSeverity() const { return mSeverity; } - /* -------------------------------------------------------------------------------------------- * Retrieve log message. */ SQMOD_NODISCARD const std::string & GetMessage() const { return mMessage; } }; +/* ------------------------------------------------------------------------------------------------ + * Guild join request delete (user declined membership screening) event. +*/ +struct DpGuildJoinRequestDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + dpp::snowflake mGuildID{}; + dpp::snowflake mUserID{}; + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildJoinRequestDeleteEvent(const dpp::guild_join_request_delete_t & d) noexcept + : DpEventBase(d), mGuildID(d.guild_id), mUserID(d.user_id) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildJoinRequestDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildJoinRequestDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildJoinRequestDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + /* -------------------------------------------------------------------------------------------- + * Retrieve the guild id. + */ + SQMOD_NODISCARD dpp::snowflake GetGuildID() const { return Valid().mGuildID; } + /* -------------------------------------------------------------------------------------------- + * Retrieve the user id. + */ + SQMOD_NODISCARD dpp::snowflake GetUserID() const { return Valid().mUserID; } +}; + +/* ------------------------------------------------------------------------------------------------ + * Create interaction event. +*/ +struct DpInteractionCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpInteractionCreateEvent(const dpp::interaction_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [InteractionCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpInteractionCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpInteractionCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Click on button event. +*/ +struct DpButtonClickEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpButtonClickEvent(const dpp::button_click_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ButtonClick] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpButtonClickEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpButtonClickEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * event. +*/ +struct DpSelectClickEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpSelectClickEvent(const dpp::select_click_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [SelectClick] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpSelectClickEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpSelectClickEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Delete guild event. +*/ +struct DpGuildDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildDeleteEvent(const dpp::guild_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Delete channel event. +*/ +struct DpChannelDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpChannelDeleteEvent(const dpp::channel_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ChannelDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpChannelDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpChannelDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Update channel event. +*/ +struct DpChannelUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpChannelUpdateEvent(const dpp::channel_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ChannelUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpChannelUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpChannelUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + /* ------------------------------------------------------------------------------------------------ * Session ready event. */ @@ -329,32 +537,24 @@ struct DpReadyEvent : public DpEventBase // -------------------------------------------------------------------------------------------- std::string mSessionID{}; uint32_t mShardID{}; - /* -------------------------------------------------------------------------------------------- * Explicit constructor. */ explicit DpReadyEvent(const dpp::ready_t & d) noexcept - : DpEventBase(d) - , mSessionID(d.session_id) - , mShardID(d.shard_id) - { - } - + : DpEventBase(d), mSessionID(d.session_id), mShardID(d.shard_id) + { } /* -------------------------------------------------------------------------------------------- * Validate the managed handle. */ void Validate() const { if (!mFrom) STHROWF("Invalid discord [Ready] event handle"); } - /* -------------------------------------------------------------------------------------------- * Validate the managed handle and retrieve a reference to it. */ SQMOD_NODISCARD DpReadyEvent & Valid() { Validate(); return *this; } - /* -------------------------------------------------------------------------------------------- * Validate the managed handle and retrieve a const reference to it. */ SQMOD_NODISCARD const DpReadyEvent & Valid() const { Validate(); return *this; } - /* -------------------------------------------------------------------------------------------- * Cleanup after the event was processed. */ @@ -363,21 +563,2058 @@ struct DpReadyEvent : public DpEventBase // Allow the base to cleanup as well DpEventBase::Cleanup(); } - /* -------------------------------------------------------------------------------------------- * Retrieve the raw event. */ SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } - /* -------------------------------------------------------------------------------------------- * Retrieve the session id. */ SQMOD_NODISCARD const std::string & GetSessionID() const { return Valid().mSessionID; } - /* -------------------------------------------------------------------------------------------- * Retrieve the shard id. */ SQMOD_NODISCARD SQInteger GetShardID() const { return static_cast< SQInteger >(Valid().mShardID); } }; +/* ------------------------------------------------------------------------------------------------ + * Message deleted event. +*/ +struct DpMessageDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageDeleteEvent(const dpp::message_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Delete application slash command event. +*/ +struct DpApplicationCommandDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpApplicationCommandDeleteEvent(const dpp::application_command_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ApplicationCommandDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpApplicationCommandDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpApplicationCommandDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild member remove event. +*/ +struct DpGuildMemberRemoveEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildMemberRemoveEvent(const dpp::guild_member_remove_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildMemberRemove] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildMemberRemoveEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildMemberRemoveEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Create application slash command event. +*/ +struct DpApplicationCommandCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpApplicationCommandCreateEvent(const dpp::application_command_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ApplicationCommandCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpApplicationCommandCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpApplicationCommandCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Session resumed event. +*/ +struct DpResumedEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpResumedEvent(const dpp::resumed_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [Resumed] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpResumedEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpResumedEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild role create event. +*/ +struct DpGuildRoleCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildRoleCreateEvent(const dpp::guild_role_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildRoleCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildRoleCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildRoleCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Typing start event. +*/ +struct DpTypingStartEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpTypingStartEvent(const dpp::typing_start_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [TypingStart] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpTypingStartEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpTypingStartEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Message reaction add event. +*/ +struct DpMessageReactionAddEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageReactionAddEvent(const dpp::message_reaction_add_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageReactionAdd] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageReactionAddEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageReactionAddEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild members chunk event. +*/ +struct DpGuildMembersChunkEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildMembersChunkEvent(const dpp::guild_members_chunk_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildMembersChunk] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildMembersChunkEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildMembersChunkEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Message reaction remove event. +*/ +struct DpMessageReactionRemoveEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageReactionRemoveEvent(const dpp::message_reaction_remove_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageReactionRemove] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageReactionRemoveEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageReactionRemoveEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Create guild event. +*/ +struct DpGuildCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildCreateEvent(const dpp::guild_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Create channel event. +*/ +struct DpChannelCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpChannelCreateEvent(const dpp::channel_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ChannelCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpChannelCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpChannelCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Message remove emoji event. +*/ +struct DpMessageReactionRemoveEmojiEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageReactionRemoveEmojiEvent(const dpp::message_reaction_remove_emoji_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageReactionRemoveEmoji] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageReactionRemoveEmojiEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageReactionRemoveEmojiEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Message delete bulk event. +*/ +struct DpMessageDeleteBulkEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageDeleteBulkEvent(const dpp::message_delete_bulk_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageDeleteBulk] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageDeleteBulkEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageDeleteBulkEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild role update event. +*/ +struct DpGuildRoleUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildRoleUpdateEvent(const dpp::guild_role_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildRoleUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildRoleUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildRoleUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild role delete event. +*/ +struct DpGuildRoleDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildRoleDeleteEvent(const dpp::guild_role_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildRoleDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildRoleDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildRoleDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Channel pins update event. +*/ +struct DpChannelPinsUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpChannelPinsUpdateEvent(const dpp::channel_pins_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ChannelPinsUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpChannelPinsUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpChannelPinsUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Message remove all reactions event. +*/ +struct DpMessageReactionRemoveAllEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageReactionRemoveAllEvent(const dpp::message_reaction_remove_all_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageReactionRemoveAll] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageReactionRemoveAllEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageReactionRemoveAllEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Voice server update event. +*/ +struct DpVoiceServerUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpVoiceServerUpdateEvent(const dpp::voice_server_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [VoiceServerUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpVoiceServerUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpVoiceServerUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild emojis update event. +*/ +struct DpGuildEmojisUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildEmojisUpdateEvent(const dpp::guild_emojis_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildEmojisUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildEmojisUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildEmojisUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Update guild stickers event. +*/ +struct DpGuildStickersUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildStickersUpdateEvent(const dpp::guild_stickers_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildStickersUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildStickersUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildStickersUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Presence update event. +*/ +struct DpPresenceUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpPresenceUpdateEvent(const dpp::presence_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [PresenceUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpPresenceUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpPresenceUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Webhooks update event. +*/ +struct DpWebhooksUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpWebhooksUpdateEvent(const dpp::webhooks_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [WebhooksUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpWebhooksUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpWebhooksUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild member add event. +*/ +struct DpGuildMemberAddEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildMemberAddEvent(const dpp::guild_member_add_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildMemberAdd] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildMemberAddEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildMemberAddEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Invite delete event. +*/ +struct DpInviteDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpInviteDeleteEvent(const dpp::invite_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [InviteDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpInviteDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpInviteDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild update event. +*/ +struct DpGuildUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildUpdateEvent(const dpp::guild_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild integrations update event. +*/ +struct DpGuildIntegrationsUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildIntegrationsUpdateEvent(const dpp::guild_integrations_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildIntegrationsUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildIntegrationsUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildIntegrationsUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild member update event. +*/ +struct DpGuildMemberUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildMemberUpdateEvent(const dpp::guild_member_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildMemberUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildMemberUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildMemberUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Update application slash command event. +*/ +struct DpApplicationCommandUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpApplicationCommandUpdateEvent(const dpp::application_command_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ApplicationCommandUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpApplicationCommandUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpApplicationCommandUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Invite create event. +*/ +struct DpInviteCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpInviteCreateEvent(const dpp::invite_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [InviteCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpInviteCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpInviteCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Message update event. +*/ +struct DpMessageUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageUpdateEvent(const dpp::message_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * User update event. +*/ +struct DpUserUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpUserUpdateEvent(const dpp::user_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [UserUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpUserUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpUserUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Create message event. +*/ +struct DpMessageCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpMessageCreateEvent(const dpp::message_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [MessageCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpMessageCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpMessageCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild ban add event. +*/ +struct DpGuildBanAddEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildBanAddEvent(const dpp::guild_ban_add_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildBanAdd] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildBanAddEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildBanAddEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Guild ban remove event. +*/ +struct DpGuildBanRemoveEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpGuildBanRemoveEvent(const dpp::guild_ban_remove_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [GuildBanRemove] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpGuildBanRemoveEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpGuildBanRemoveEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Integration create event. +*/ +struct DpIntegrationCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpIntegrationCreateEvent(const dpp::integration_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [IntegrationCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpIntegrationCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpIntegrationCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Integration update event. +*/ +struct DpIntegrationUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpIntegrationUpdateEvent(const dpp::integration_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [IntegrationUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpIntegrationUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpIntegrationUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Integration delete event. +*/ +struct DpIntegrationDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpIntegrationDeleteEvent(const dpp::integration_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [IntegrationDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpIntegrationDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpIntegrationDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Thread create event. +*/ +struct DpThreadCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpThreadCreateEvent(const dpp::thread_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ThreadCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpThreadCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpThreadCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Thread update event. +*/ +struct DpThreadUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpThreadUpdateEvent(const dpp::thread_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ThreadUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpThreadUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpThreadUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Thread delete event. +*/ +struct DpThreadDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpThreadDeleteEvent(const dpp::thread_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ThreadDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpThreadDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpThreadDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Thread list sync event. +*/ +struct DpThreadListSyncEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpThreadListSyncEvent(const dpp::thread_list_sync_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ThreadListSync] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpThreadListSyncEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpThreadListSyncEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Thread member update event. +*/ +struct DpThreadMemberUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpThreadMemberUpdateEvent(const dpp::thread_member_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ThreadMemberUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpThreadMemberUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpThreadMemberUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Thread members update event. +*/ +struct DpThreadMembersUpdateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpThreadMembersUpdateEvent(const dpp::thread_members_update_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [ThreadMembersUpdate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpThreadMembersUpdateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpThreadMembersUpdateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Voice buffer send event. +*/ +struct DpVoiceBufferSendEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpVoiceBufferSendEvent(const dpp::voice_buffer_send_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [VoiceBufferSend] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpVoiceBufferSendEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpVoiceBufferSendEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Voice user talking event. +*/ +struct DpVoiceUserTalkingEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpVoiceUserTalkingEvent(const dpp::voice_user_talking_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [VoiceUserTalking] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpVoiceUserTalkingEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpVoiceUserTalkingEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Voice user talking event. +*/ +struct DpVoiceReadyEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpVoiceReadyEvent(const dpp::voice_ready_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [VoiceReady] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpVoiceReadyEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpVoiceReadyEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Voice receive packet event. +*/ +struct DpVoiceReceiveEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpVoiceReceiveEvent(const dpp::voice_receive_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [VoiceReceive] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpVoiceReceiveEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpVoiceReceiveEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Voice state update event. +*/ +struct DpVoiceTrackMarkerEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpVoiceTrackMarkerEvent(const dpp::voice_track_marker_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [VoiceTrackMarker] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpVoiceTrackMarkerEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpVoiceTrackMarkerEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Create stage instance event. +*/ +struct DpStageInstanceCreateEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpStageInstanceCreateEvent(const dpp::stage_instance_create_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [StageInstanceCreate] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpStageInstanceCreateEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpStageInstanceCreateEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + +/* ------------------------------------------------------------------------------------------------ + * Delete stage instance event. +*/ +struct DpStageInstanceDeleteEvent : public DpEventBase +{ + // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * Explicit constructor. + */ + explicit DpStageInstanceDeleteEvent(const dpp::stage_instance_delete_t & d) noexcept + : DpEventBase(d) + { } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle. + */ + void Validate() const { if (!mFrom) STHROWF("Invalid discord [StageInstanceDelete] event handle"); } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a reference to it. + */ + SQMOD_NODISCARD DpStageInstanceDeleteEvent & Valid() { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Validate the managed handle and retrieve a const reference to it. + */ + SQMOD_NODISCARD const DpStageInstanceDeleteEvent & Valid() const { Validate(); return *this; } + /* -------------------------------------------------------------------------------------------- + * Cleanup after the event was processed. + */ + void Cleanup() override + { + // Allow the base to cleanup as well + DpEventBase::Cleanup(); + } + /* -------------------------------------------------------------------------------------------- + * Retrieve the raw event. + */ + SQMOD_NODISCARD const std::string & GetRawEvent() const { return Valid().mRaw; } + +}; + } // Namespace:: SqMod diff --git a/module/Library/DPPTy.cpp b/module/Library/DPPTy.cpp index 407188e6..e70689c3 100644 --- a/module/Library/DPPTy.cpp +++ b/module/Library/DPPTy.cpp @@ -327,7 +327,17 @@ static const EnumElement g_DpPresenceFlagsEnum[] = { {_SC("MobileIdle"), static_cast< SQInteger >(dpp::p_mobile_idle)}, {_SC("StatusOnline"), static_cast< SQInteger >(dpp::p_status_online)}, {_SC("StatusDND"), static_cast< SQInteger >(dpp::p_status_dnd)}, - {_SC("StatusIdle"), static_cast< SQInteger >(dpp::p_status_idle)} + {_SC("StatusIdle"), static_cast< SQInteger >(dpp::p_status_idle)}, + // Helper bit-shift flags + {_SC("BitShiftDesktop"), static_cast< SQInteger >(PF_SHIFT_DESKTOP)}, + {_SC("BitShiftWeb"), static_cast< SQInteger >(PF_SHIFT_WEB)}, + {_SC("BitShiftMobile"), static_cast< SQInteger >(PF_SHIFT_MOBILE)}, + {_SC("BitShiftMain"), static_cast< SQInteger >(PF_SHIFT_MAIN)}, + {_SC("BitStatusMask"), static_cast< SQInteger >(PF_STATUS_MASK)}, + {_SC("BitClearDesktop"), static_cast< SQInteger >(PF_CLEAR_DESKTOP)}, + {_SC("BitClearWeb"), static_cast< SQInteger >(PF_CLEAR_WEB)}, + {_SC("BitClearMobile"), static_cast< SQInteger >(PF_CLEAR_MOBILE)}, + {_SC("BitClearStatus"), static_cast< SQInteger >(PF_CLEAR_STATUS)}, }; // ------------------------------------------------------------------------------------------------