Skip to content

Add Moderation Extension #12

@PenguinBoi12

Description

@PenguinBoi12

As an admin, I want better moderation tools than what Matrix provides. This issue proposes a set of bot commands to handle common moderation actions across all rooms in a space. This issue can be split into multiple PRs.

Commands

ban - Permanently bans a user from the server
kick - Kicks a user from the server
tempkick - Temporarily kicks a user from the server
purge - Bulk-deletes messages

  • All commands should apply across every room in the space where the bot is present, not just the room where the command is issued.
  • All usage are only for inspiration and can be different at the implementation

Ban

Bans a user across all rooms in the space.

Requirements:

  • Ban applies to all rooms in the space where the bot is a member.
  • Optionally delete the user's recent messages as part of the ban.
    • For the initial implementation, default to deleting messages from the last hour.

Usage:

!ban @astra:matrix.org [reason]

Kick

Kicks a user from all rooms in the space.

Requirements:

  • Kick applies to all rooms in the space where the bot is a member.
  • The user is free to rejoin (unlike ban).

Usage:

kick @astra:matrix.org [reason]

tempkick

Same behavior as kick, but the user is prevented from rejoining until the timeout expires.

Requirements:

  • Accepts a duration argument. The minimal implementation can use a single fixed unit (e.g. minutes).
  • The user cannot rejoin any room in the space until the duration elapses.
  • Once the timeout expires, the temporary ban is lifted automatically.

Usage:

!tempkick @user:example.com 30 [reason]

purge (delete messages)

Requirements:

  • Delete messages by count (e.g. last N messages).
  • If no count is specified, default to deleting all messages from the last hour.
  • Support targeting a specific user (delete only that user's messages within the range).
  • When a message is deleted, post a copy of it to a configurable moderation-log channel so moderators have a record.

Usage:

!purge 50                    # delete the last 50 messages
!purge                       # delete all messages from the last hour
!purge @user:example.com 50  # delete the last 50 messages from a specific user
!purge @user:example.com     # delete all messages from a user in the last hour

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions