# cpl_discord.service package

## Submodules

## cpl_discord.service.command_error_handler_service module

class cpl_discord.service.command_error_handler_service.CommandErrorHandlerService(logger: LoggerABC )

  Bases: `OnCommandErrorABC`

  async on_command_error(ctx: Context, error: CommandError)

## cpl_discord.service.discord_bot_service module

class cpl_discord.service.discord_bot_service.DiscordBotService(config: ConfigurationABC, logger: LoggerABC, discord_bot_settings: DiscordBotSettings, env: ApplicationEnvironmentABC, logging_st: LoggingSettings, discord_service: DiscordServiceABC )

  Bases: `DiscordBotServiceABC`

  property guilds: Guild

    Sequence[`Guild`]: The guilds that the connected client is a member of.

  async on_ready()
  async start_async()
  async stop_async()

## cpl_discord.service.discord_bot_service_abc module

class cpl_discord.service.discord_bot_service_abc.DiscordBotServiceABC(**kwargs)

  Bases: `Bot`

  abstract property guilds: Guild

    Sequence[`Guild`]: The guilds that the connected client is a member of.

  abstract async on_ready()
  abstract async start_async()
  abstract async stop_async()

## cpl_discord.service.discord_collection module

class cpl_discord.service.discord_collection.DiscordCollection(service_collection: ServiceCollectionABC )

  Bases: `DiscordCollectionABC`

  add_command(_t: Type[ DiscordCommandABC ])
  add_event(_t_event: Type, _t: Type)
  get_commands() → DiscordCommandABC
  get_events_by_base(_t_event: Type) → Optional[ List ]

## cpl_discord.service.discord_collection_abc module

class cpl_discord.service.discord_collection_abc.DiscordCollectionABC

  Bases: `ABC`

  abstract add_command(_t: Type[ DiscordCommandABC ])
  abstract add_event(_t_event: Type, _t: Type)
  abstract get_commands() → DiscordCommandABC
  abstract get_events_by_base(_t_event: Type)

## cpl_discord.service.discord_service module

class cpl_discord.service.discord_service.DiscordService(*args: Any, **kwargs: Any)

  Bases: `DiscordServiceABC`, `Cog`

  async init(bot: Bot)
  async on_bulk_message_delete(messages: list[discord.message.Message])
  async on_command(ctx: Context)
  async on_command_completion(ctx: Context)
  async on_command_error(ctx: Context, error: CommandError)
  async on_connect()
  async on_disconnect()
  async on_error(event: str, *args, **kwargs)
  async on_group_join(channel: GroupChannel, user: User)
  async on_group_remove(channel: GroupChannel, user: User)
  async on_guild_available(guild: Guild)
  async on_guild_channel_create(channel: GuildChannel)
  async on_guild_channel_delete(channel: GuildChannel)
  async on_guild_channel_pins_update(channel: GuildChannel, list_pin: Optional[datetime])
  async on_guild_channel_update(before: GuildChannel, after: GuildChannel)
  async on_guild_emojis_update(guild: Guild, before: Sequence[Emoji], after: Sequence[Emoji])
  async on_guild_integrations_update(guild: Guild)
  async on_guild_join(guild: Guild)
  async on_guild_remove(guild: Guild)
  async on_guild_role_create(role: Role)
  async on_guild_role_delete(role: Role)
  async on_guild_role_update(before: Role, after: Role)
  async on_guild_unavailable(guild: Guild)
  async on_guild_update(before: Guild, after: Guild)
  async on_invite_create(invite: Invite)
  async on_invite_delete(invite: Invite)
  async on_member_ban(guild: Guild, user: User)
  async on_member_join(member: Member)
  async on_member_remove(member: Member)
  async on_member_unban(guild: Guild, user: User)
  async on_member_update(before: Member, after: Member)
  async on_message(message: Message)
  async on_message_delete(message: Message)
  async on_message_edit(before: Message, after: Message)
  async on_private_channel_create(channel: PrivateChannel)
  async on_private_channel_delete(channel: PrivateChannel)
  async on_private_channel_pins_update(channel: PrivateChannel, list_pin: Optional[datetime])
  async on_private_channel_update(before: GroupChannel, after: GroupChannel)
  async on_raw_reaction_add(payload: RawReactionActionEvent)
  async on_raw_reaction_clear(payload: RawReactionActionEvent)
  async on_raw_reaction_clear_emoji(payload: RawReactionActionEvent)
  async on_raw_reaction_remove(payload: RawReactionActionEvent)
  async on_reaction_add(reaction: Reaction, user: User)
  async on_reaction_clear(message: Message, reactions: list[discord.reaction.Reaction])
  async on_reaction_clear_emoji(reaction: Reaction)
  async on_reaction_remove(reaction: Reaction, user: User)
  async on_ready()
  async on_resume()
  async on_typing(channel: Messageable, user: Union[User, Member], when: datetime)
  async on_user_update(before: User, after: User)
  async on_voice_state_update(member: Member, before: VoiceState, after: VoiceState)
  async on_webhooks_update(channel: GuildChannel)

## cpl_discord.service.discord_service_abc module

class cpl_discord.service.discord_service_abc.DiscordServiceABC

  Bases: `ABC`

  abstract init(bot: Bot)
  abstract async on_bulk_message_delete(messages: list[discord.message.Message])
  abstract async on_command()
  abstract async on_command_completion()
  abstract async on_command_error()
  abstract async on_connect()
  abstract async on_disconnect()
  abstract async on_error(event: str, *args, **kwargs)
  abstract async on_group_join(chhanel: GroupChannel, user: User)
  abstract async on_group_remove(chhanel: GroupChannel, user: User)
  abstract async on_guild_available(guild: Guild)
  abstract async on_guild_channel_create(channel: GuildChannel)
  abstract async on_guild_channel_delete(channel: GuildChannel)
  abstract async on_guild_channel_pins_update(channel: GuildChannel, list_pin: Optional[datetime])
  abstract async on_guild_channel_update(before: GuildChannel, after: GuildChannel)
  abstract async on_guild_emojis_update(guild: Guild, before: Sequence[Emoji], after: Sequence[Emoji])
  abstract async on_guild_integrations_update(guild: Guild)
  abstract async on_guild_join(guild: Guild)
  abstract async on_guild_remove(guild: Guild)
  abstract async on_guild_role_create(role: Role)
  abstract async on_guild_role_delete(role: Role)
  abstract async on_guild_role_update(before: Role, after: Role)
  abstract async on_guild_unavailable(guild: Guild)
  abstract async on_guild_update(before: Guild, after: Guild)
  abstract async on_invite_create(invite: Invite)
  abstract async on_invite_delete(invite: Invite)
  abstract async on_member_ban(guild: Guild, user: User)
  abstract async on_member_join(member: Member)
  abstract async on_member_remove(member: Member)
  abstract async on_member_unban(guild: Guild, user: User)
  abstract async on_member_update(before: Member, after: Member)
  abstract async on_message(message: Message)
  abstract async on_message_delete(message: Message)
  abstract async on_message_edit(before: Message, after: Message)
  abstract async on_private_channel_create(channel: PrivateChannel)
  abstract async on_private_channel_delete(channel: PrivateChannel)
  abstract async on_private_channel_pins_update(channel: PrivateChannel, list_pin: Optional[datetime])
  abstract async on_private_channel_update(before: GroupChannel, after: GroupChannel)
  abstract async on_reaction_add(reaction: Reaction, user: User)
  abstract async on_reaction_clear(message: Message, reactions: list[discord.reaction.Reaction])
  abstract async on_reaction_clear_emoji(reaction: Reaction)
  abstract async on_reaction_remove(reaction: Reaction, user: User)
  abstract async on_ready()
  abstract async on_resume()
  abstract async on_typing(channel: Messageable, user: Union[User, Member], when: datetime)
  abstract async on_user_update(before: User, after: User)
  abstract async on_voice_state_update(member: Member, before: VoiceState, after: VoiceState)
  abstract async on_webhooks_update(channel: GuildChannel)

## Module contents

### cpl-discord CPL Discord

Link between discord.py and CPL

copyright

  3. 2022 - 2023 sh-edraft.de

license

  MIT, see LICENSE for more details.

class cpl_discord.service.VersionInfo(major, minor, micro)

  Bases: `tuple`

  major

    Alias for field number 0

  micro

    Alias for field number 2

  minor

    Alias for field number 1