Updated cpl-discord #404

This commit is contained in:
Sven Heidemann 2023-10-13 15:24:02 +02:00
parent 0946734633
commit 232429a77d
13 changed files with 54 additions and 54 deletions

View File

@ -19,7 +19,7 @@
"cpl-core==2023.10.0", "cpl-core==2023.10.0",
"cpl-translation==2023.4.0.post1", "cpl-translation==2023.4.0.post1",
"cpl-query==2023.10.0", "cpl-query==2023.10.0",
"cpl-discord==2023.10.0", "cpl-discord==2023.10.0.post1",
"Flask==3.0.0", "Flask==3.0.0",
"Flask-Classful==0.16.0", "Flask-Classful==0.16.0",
"Flask-Cors==4.0.0", "Flask-Cors==4.0.0",

View File

@ -48,4 +48,4 @@ class ApiModule(ModuleABC):
services.add_transient(GraphQLController) services.add_transient(GraphQLController)
# cpl-discord # cpl-discord
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, BotApiOnReadyEvent) services.add_transient(DiscordEventTypesEnum.on_ready.value, BotApiOnReadyEvent)

View File

@ -19,4 +19,4 @@ class CoreExtensionModule(ModuleABC):
pass pass
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC): def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, CoreExtensionOnReadyEvent) services.add_transient(DiscordEventTypesEnum.on_ready.value, CoreExtensionOnReadyEvent)

View File

@ -32,4 +32,4 @@ class CoreModule(ModuleABC):
# pipes # pipes
services.add_transient(DateTimeOffsetPipe) services.add_transient(DateTimeOffsetPipe)
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, CoreOnReadyEvent) services.add_transient(DiscordEventTypesEnum.on_ready.value, CoreOnReadyEvent)

View File

@ -26,9 +26,9 @@ class AchievementsModule(ModuleABC):
services.add_transient(AchievementAttributeResolver) services.add_transient(AchievementAttributeResolver)
services.add_transient(AchievementService) services.add_transient(AchievementService)
self._dc.add_command(AchievementGroup) services.add_transient(AchievementGroup)
self._dc.add_event(DiscordEventTypesEnum.on_message.value, AchievementOnMessageEvent) services.add_transient(DiscordEventTypesEnum.on_message.value, AchievementOnMessageEvent)
self._dc.add_event(DiscordEventTypesEnum.on_reaction_add.value, AchievementOnReactionAddEvent) services.add_transient(DiscordEventTypesEnum.on_reaction_add.value, AchievementOnReactionAddEvent)
self._dc.add_event(DiscordEventTypesEnum.on_reaction_remove.value, AchievementOnReactionRemoveEvent) services.add_transient(DiscordEventTypesEnum.on_reaction_remove.value, AchievementOnReactionRemoveEvent)
self._dc.add_event(DiscordEventTypesEnum.on_voice_state_update.value, AchievementOnVoiceStateUpdateEvent) services.add_transient(DiscordEventTypesEnum.on_voice_state_update.value, AchievementOnVoiceStateUpdateEvent)

View File

@ -26,13 +26,13 @@ class AutoRoleModule(ModuleABC):
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC): def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
services.add_transient(AutoRoleReactionHandler) services.add_transient(AutoRoleReactionHandler)
# commands # commands
self._dc.add_command(AutoRoleGroup) services.add_transient(AutoRoleGroup)
# events # events
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_raw_reaction_add.value, DiscordEventTypesEnum.on_raw_reaction_add.value,
AutoRoleOnRawReactionAddEvent, AutoRoleOnRawReactionAddEvent,
) )
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_raw_reaction_remove.value, DiscordEventTypesEnum.on_raw_reaction_remove.value,
AutoRoleOnRawReactionRemoveEvent, AutoRoleOnRawReactionRemoveEvent,
) )

View File

@ -65,49 +65,49 @@ class BaseModule(ModuleABC):
services.add_transient(ComplaintForm) services.add_transient(ComplaintForm)
# commands # commands
self._dc.add_command(AFKCommand) services.add_transient(AFKCommand)
self._dc.add_command(SubmitGroup) services.add_transient(SubmitGroup)
self._dc.add_command(HelpCommand) services.add_transient(HelpCommand)
self._dc.add_command(InfoCommand) services.add_transient(InfoCommand)
self._dc.add_command(MassMoveCommand) services.add_transient(MassMoveCommand)
self._dc.add_command(PingCommand) services.add_transient(PingCommand)
self._dc.add_command(PresenceCommand) services.add_transient(PresenceCommand)
self._dc.add_command(MakeCoffeeCommand) services.add_transient(MakeCoffeeCommand)
self._dc.add_command(PurgeCommand) services.add_transient(PurgeCommand)
self._dc.add_command(UserGroup) services.add_transient(UserGroup)
self._dc.add_command(RegisterGroup) services.add_transient(RegisterGroup)
self._dc.add_command(UnregisterGroup) services.add_transient(UnregisterGroup)
self._dc.add_command(GameServerGroup) services.add_transient(GameServerGroup)
# events # events
self._dc.add_event(DiscordEventTypesEnum.on_command.value, BaseOnCommandEvent) services.add_transient(DiscordEventTypesEnum.on_command.value, BaseOnCommandEvent)
self._dc.add_event(DiscordEventTypesEnum.on_command_error.value, BaseOnCommandErrorEvent) services.add_transient(DiscordEventTypesEnum.on_command_error.value, BaseOnCommandErrorEvent)
self._dc.add_event(DiscordEventTypesEnum.on_member_join.value, BaseOnMemberJoinEvent) services.add_transient(DiscordEventTypesEnum.on_member_join.value, BaseOnMemberJoinEvent)
self._dc.add_event(DiscordEventTypesEnum.on_member_remove.value, BaseOnMemberRemoveEvent) services.add_transient(DiscordEventTypesEnum.on_member_remove.value, BaseOnMemberRemoveEvent)
self._dc.add_event(DiscordEventTypesEnum.on_message.value, BaseOnMessageEvent) services.add_transient(DiscordEventTypesEnum.on_message.value, BaseOnMessageEvent)
self._dc.add_event(DiscordEventTypesEnum.on_message_delete.value, BaseOnMessageDeleteEvent) services.add_transient(DiscordEventTypesEnum.on_message_delete.value, BaseOnMessageDeleteEvent)
self._dc.add_event(DiscordEventTypesEnum.on_raw_reaction_add.value, BaseOnRawReactionAddEvent) services.add_transient(DiscordEventTypesEnum.on_raw_reaction_add.value, BaseOnRawReactionAddEvent)
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_raw_reaction_remove.value, DiscordEventTypesEnum.on_raw_reaction_remove.value,
BaseOnRawReactionRemoveEvent, BaseOnRawReactionRemoveEvent,
) )
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_voice_state_update.value, DiscordEventTypesEnum.on_voice_state_update.value,
BaseOnVoiceStateUpdateEvent, BaseOnVoiceStateUpdateEvent,
) )
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_voice_state_update.value, DiscordEventTypesEnum.on_voice_state_update.value,
BaseOnVoiceStateUpdateEventHelpChannel, BaseOnVoiceStateUpdateEventHelpChannel,
) )
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_voice_state_update.value, DiscordEventTypesEnum.on_voice_state_update.value,
BaseOnVoiceStateUpdateEventScheduledEventBonus, BaseOnVoiceStateUpdateEventScheduledEventBonus,
) )
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_scheduled_event_update.value, DiscordEventTypesEnum.on_scheduled_event_update.value,
BaseOnScheduledEventUpdateEvent, BaseOnScheduledEventUpdateEvent,
) )
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_guild_join.value, DiscordEventTypesEnum.on_guild_join.value,
BaseOnGuildJoinEvent, BaseOnGuildJoinEvent,
) )

View File

@ -19,4 +19,4 @@ class BootLogModule(ModuleABC):
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC): def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
# commands # commands
# events # events
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, BootLogOnReadyEvent) services.add_transient(DiscordEventTypesEnum.on_ready.value, BootLogOnReadyEvent)

View File

@ -17,4 +17,4 @@ class ConfigModule(ModuleABC):
pass pass
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC): def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, ConfigOnReadyEvent) services.add_transient(DiscordEventTypesEnum.on_ready.value, ConfigOnReadyEvent)

View File

@ -19,4 +19,4 @@ class DatabaseModule(ModuleABC):
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC): def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
# commands # commands
# events # events
self._dc.add_event(DiscordEventTypesEnum.on_ready.value, DatabaseOnReadyEvent) services.add_transient(DiscordEventTypesEnum.on_ready.value, DatabaseOnReadyEvent)

View File

@ -36,14 +36,14 @@ class LevelModule(ModuleABC):
services.add_transient(LevelService) services.add_transient(LevelService)
# commands # commands
self._dc.add_command(LevelGroup) services.add_transient(LevelGroup)
# events # events
self._dc.add_event(DiscordEventTypesEnum.on_message.value, LevelOnMessageEvent) services.add_transient(DiscordEventTypesEnum.on_message.value, LevelOnMessageEvent)
self._dc.add_event( services.add_transient(
DiscordEventTypesEnum.on_voice_state_update.value, DiscordEventTypesEnum.on_voice_state_update.value,
LevelOnVoiceStateUpdateEvent, LevelOnVoiceStateUpdateEvent,
) )
self._dc.add_event(DiscordEventTypesEnum.on_member_join.value, LevelOnMemberJoinEvent) services.add_transient(DiscordEventTypesEnum.on_member_join.value, LevelOnMemberJoinEvent)
self._dc.add_event(DiscordEventTypesEnum.on_raw_reaction_add.value, LevelOnRawReactionAddEvent) services.add_transient(DiscordEventTypesEnum.on_raw_reaction_add.value, LevelOnRawReactionAddEvent)
self._dc.add_event(DiscordEventTypesEnum.on_raw_reaction_remove.value, LevelOnRawReactionRemoveEvent) services.add_transient(DiscordEventTypesEnum.on_raw_reaction_remove.value, LevelOnRawReactionRemoveEvent)

View File

@ -25,6 +25,6 @@ class ShortRoleNameModule(ModuleABC):
services.add_transient(ShortRoleNameService) services.add_transient(ShortRoleNameService)
# commands # commands
self._dc.add_command(ShortRoleNameCheckCommand) services.add_transient(ShortRoleNameCheckCommand)
# events # events
self._dc.add_event(DiscordEventTypesEnum.on_member_update.value, ShortRoleNameOnMemberUpdateEvent) services.add_transient(DiscordEventTypesEnum.on_member_update.value, ShortRoleNameOnMemberUpdateEvent)

View File

@ -24,9 +24,9 @@ class TechnicianModule(ModuleABC):
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC): def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
services.add_transient(DataSeederABC, ApiKeySeeder) services.add_transient(DataSeederABC, ApiKeySeeder)
# commands # commands
self._dc.add_command(RestartCommand) services.add_transient(RestartCommand)
self._dc.add_command(ShutdownCommand) services.add_transient(ShutdownCommand)
self._dc.add_command(LogCommand) services.add_transient(LogCommand)
self._dc.add_command(ApiKeyGroup) services.add_transient(ApiKeyGroup)
self._dc.add_command(SyncXpGroup) services.add_transient(SyncXpGroup)
# events # events