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-translation==2023.4.0.post1",
"cpl-query==2023.10.0",
"cpl-discord==2023.10.0",
"cpl-discord==2023.10.0.post1",
"Flask==3.0.0",
"Flask-Classful==0.16.0",
"Flask-Cors==4.0.0",

View File

@ -48,4 +48,4 @@ class ApiModule(ModuleABC):
services.add_transient(GraphQLController)
# 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
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
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(AchievementService)
self._dc.add_command(AchievementGroup)
services.add_transient(AchievementGroup)
self._dc.add_event(DiscordEventTypesEnum.on_message.value, AchievementOnMessageEvent)
self._dc.add_event(DiscordEventTypesEnum.on_reaction_add.value, AchievementOnReactionAddEvent)
self._dc.add_event(DiscordEventTypesEnum.on_reaction_remove.value, AchievementOnReactionRemoveEvent)
self._dc.add_event(DiscordEventTypesEnum.on_voice_state_update.value, AchievementOnVoiceStateUpdateEvent)
services.add_transient(DiscordEventTypesEnum.on_message.value, AchievementOnMessageEvent)
services.add_transient(DiscordEventTypesEnum.on_reaction_add.value, AchievementOnReactionAddEvent)
services.add_transient(DiscordEventTypesEnum.on_reaction_remove.value, AchievementOnReactionRemoveEvent)
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):
services.add_transient(AutoRoleReactionHandler)
# commands
self._dc.add_command(AutoRoleGroup)
services.add_transient(AutoRoleGroup)
# events
self._dc.add_event(
services.add_transient(
DiscordEventTypesEnum.on_raw_reaction_add.value,
AutoRoleOnRawReactionAddEvent,
)
self._dc.add_event(
services.add_transient(
DiscordEventTypesEnum.on_raw_reaction_remove.value,
AutoRoleOnRawReactionRemoveEvent,
)

View File

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

View File

@ -19,4 +19,4 @@ class BootLogModule(ModuleABC):
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
# commands
# 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
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):
# commands
# 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)
# commands
self._dc.add_command(LevelGroup)
services.add_transient(LevelGroup)
# events
self._dc.add_event(DiscordEventTypesEnum.on_message.value, LevelOnMessageEvent)
self._dc.add_event(
services.add_transient(DiscordEventTypesEnum.on_message.value, LevelOnMessageEvent)
services.add_transient(
DiscordEventTypesEnum.on_voice_state_update.value,
LevelOnVoiceStateUpdateEvent,
)
self._dc.add_event(DiscordEventTypesEnum.on_member_join.value, LevelOnMemberJoinEvent)
self._dc.add_event(DiscordEventTypesEnum.on_raw_reaction_add.value, LevelOnRawReactionAddEvent)
self._dc.add_event(DiscordEventTypesEnum.on_raw_reaction_remove.value, LevelOnRawReactionRemoveEvent)
services.add_transient(DiscordEventTypesEnum.on_member_join.value, LevelOnMemberJoinEvent)
services.add_transient(DiscordEventTypesEnum.on_raw_reaction_add.value, LevelOnRawReactionAddEvent)
services.add_transient(DiscordEventTypesEnum.on_raw_reaction_remove.value, LevelOnRawReactionRemoveEvent)

View File

@ -25,6 +25,6 @@ class ShortRoleNameModule(ModuleABC):
services.add_transient(ShortRoleNameService)
# commands
self._dc.add_command(ShortRoleNameCheckCommand)
services.add_transient(ShortRoleNameCheckCommand)
# 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):
services.add_transient(DataSeederABC, ApiKeySeeder)
# commands
self._dc.add_command(RestartCommand)
self._dc.add_command(ShutdownCommand)
self._dc.add_command(LogCommand)
self._dc.add_command(ApiKeyGroup)
self._dc.add_command(SyncXpGroup)
services.add_transient(RestartCommand)
services.add_transient(ShutdownCommand)
services.add_transient(LogCommand)
services.add_transient(ApiKeyGroup)
services.add_transient(SyncXpGroup)
# events