Skip to content

AdminUtils

Domekologe edited this page Jun 30, 2026 · 1 revision

AdminUtils

🌐 English · Deutsch

AdminUtils bundles the day-to-day moderation actions of a Discord server into a single cog of slash/hybrid commands: kick, ban, timeout, message purging (with exception lists), moving messages between channels, moving members between voice channels, and copying role permissions. Every success message is a per-guild template you can rewrite to match your server's tone, and the whole cog wires itself into the PDC Web Dashboard so admins can edit those templates from the browser. Author: pd-codes · requires Red 3.5.0+.

Screenshot: AdminUtils slash commands in Discord

Installation

[p]repo add PDC_Redbot_Cogs https://github.com/pd-codes/PDC_Redbot_Cogs
[p]cog install PDC_Redbot_Cogs AdminUtils
[p]load AdminUtils
[p]slash sync

[p] is your bot's prefix. See Installation for the full Downloader walkthrough. Because several commands are slash-only (see the Commands table), running [p]slash sync once after loading is required.

Commands

kick, ban, timeout, purge, purgefast and messagemove are hybrid commands — usable both as [p]command and as /command. The remaining four are registered as native application commands and only work as slash commands.

Command Type Parameters What it does
kick Hybrid member, reason? Kicks a member, then posts the kick_success template.
ban Hybrid member, reason?, delete_message_days? (0–7) Bans a member and optionally deletes their recent messages. Posts ban_success.
timeout Hybrid member, minutes (1–40320), reason? Times a member out for up to 28 days. Posts timeout_success.
purge Hybrid amount (1–500), except_users? Deletes up to amount messages. Fast bulk pass for messages ≤ 14 days, then deletes older ones individually. Skips pinned messages and anyone listed in except_users. Posts purge_success.
purgefast Hybrid amount (1–500), except_users? Bulk-only delete — only messages newer than 14 days (Discord's bulk limit). Much faster than purge, but does not touch older messages.
messagemove Hybrid message (ID or link), destination, delete_original? (default true) Copies a message (text + attachments) into a target channel/thread and, unless told otherwise, deletes the original.
move-memberall Slash only source_channel, dest_channel Moves all members from one voice channel into another.
move-member Slash only source_channel, dest_channel Opens an ephemeral select menu (max. 25 members) plus confirm/cancel buttons, then moves only the chosen members.
copy-channelrole Slash only channel, source_role, dest_role Copies a single channel's permission overwrite from one role onto another role.
copy-role Slash only source_role, target_role_name Creates a brand-new role cloning the source role's server permissions, colour, hoist/mentionable flags, icon, channel overwrites and position.

About except_users

For purge and purgefast, pass except_users as a space-separated list. Each entry may be a mention (@user), a raw user ID, or a name — names are resolved against the guild by exact display-name match, then exact username, then a fuzzy "contains" search. Messages authored by matched users (and all pinned messages) are kept.

Configuration — success message templates

AdminUtils stores four message templates per guild (Red Config, identifier 708921553001). When a command succeeds it formats the matching template and replies (ephemerally for slash usage). Defaults are in German; edit them freely.

Template key Used by Available variables Default
kick_success kick {member}, {reason} ✅ {member} wurde gekickt. Grund: {reason}
ban_success ban {member}, {reason}, {delete_days} ✅ {member} wurde gebannt. Grund: {reason} | Nachrichten: {delete_days} Tage
timeout_success timeout {member}, {reason}, {minutes} ✅ {member} ist {minutes} Minuten im Timeout. Grund: {reason}
purge_success purge {deleted}, {exceptions} ✅ {deleted} Nachrichten gelöscht. Ausnahmen: {exceptions}

All template variables across the cog: {member}, {reason}, {minutes}, {delete_days}, {deleted}, {exceptions}. Only use the variables listed for a given key — an unknown placeholder in a template is left as-is.

purgefast replies with a fixed message and does not use a template. The purge command only falls back to purge_success when it has not already shown a live progress message.

Dashboard integration

AdminUtils registers with both the AAA3A Dashboard and the PDC Web Dashboard automatically on load (and re-attaches if the dashboard cog is loaded afterwards). It exposes three surfaces:

Surface Mount Permission Purpose
Widget "AdminUtils Templates" Dashboard home (KPI, small) guild_member Shows how many templates are configured.
Panel "Moderations-Nachrichten" guild_settings guild_admin Edit the kick/ban/timeout/purge templates with per-field variable hints.
Standalone page adminutils own page (GET/POST) manage_guild / bot owner Full-page editor for all four templates.

Screenshot: AdminUtils template panel in the dashboard

Permissions & notes

Every command is guarded twice — the invoking user must hold the Discord permission, and the bot must hold it too (bot_has_guild_permissions):

Command(s) Required permission (user + bot)
kick kick_members
ban ban_members
timeout moderate_members
purge, purgefast, messagemove manage_messages (+ read_message_history)
move-memberall, move-member move_members
copy-channelrole, copy-role manage_roles

For copy-role the bot's own highest role must sit above the source role, otherwise role creation or the position copy fails. The cog stores no personal data — only the per-guild templates.

See also: Installation · Dashboard Integration · Home

Clone this wiki locally