Commands for everything a dashboard can do
- /music skip, pause, resume, stop, repeat, remove, move (DJ role) - /config view, clear, toggletwitch, streamers, beta-features (server owner) - /slvl status, remove-reward; /moderation bans, timeouts; /security history - /beta is now the bot owner's DM-only command: set, off, servers, remove-server, status - betasettings service and repo methods, with integration tests Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
acdb5ead35
commit
132a2cd986
26 files changed
+1062
-65
No files matched your search
@@ -70,6 +70,7 @@ func tuneOptions() []*discordgo.ApplicationCommandOption {
|
||||
}
|
||||
return []*discordgo.ApplicationCommandOption{
|
||||
{Type: discordgo.ApplicationCommandOptionSubCommand, Name: "settings", Description: "Show every security setting"},
|
||||
{Type: discordgo.ApplicationCommandOptionSubCommand, Name: "history", Description: "Show the latest security events (raids, quarantines, setting changes)"},
|
||||
group("joingate", "Tune the Join Gate (owner or trusted)",
|
||||
sub("check", "Choose what happens when a check catches a new member",
|
||||
choiceOption("check", "Which check", true, joinGateChecks...),
|
||||
@@ -145,6 +146,35 @@ func handleTune(ctx context.Context, s *discordgo.Session, i *discordgo.Interact
|
||||
return true
|
||||
}
|
||||
reply(s, i, describeSettings(st))
|
||||
case "history":
|
||||
if !allowedOrTrusted(ctx, e, i, discordgo.PermissionManageGuild) {
|
||||
reply(s, i, "You need Manage Server to see the security history.")
|
||||
return true
|
||||
}
|
||||
events, err := e.Events(ctx, i.GuildID, 15)
|
||||
if err != nil {
|
||||
reply(s, i, message("history", err))
|
||||
return true
|
||||
}
|
||||
if len(events) == 0 {
|
||||
reply(s, i, "Nothing has happened yet.")
|
||||
return true
|
||||
}
|
||||
var b strings.Builder
|
||||
for _, ev := range events {
|
||||
fmt.Fprintf(&b, "<t:%d:R> **%s**", ev.CreatedAt.Unix(), ev.Kind)
|
||||
if ev.ActorID != 0 {
|
||||
fmt.Fprintf(&b, " by <@%d>", ev.ActorID)
|
||||
}
|
||||
if ev.TargetID != 0 {
|
||||
fmt.Fprintf(&b, " on <@%d>", ev.TargetID)
|
||||
}
|
||||
if ev.Detail != "" {
|
||||
fmt.Fprintf(&b, ": %s", clip(ev.Detail, 120))
|
||||
}
|
||||
b.WriteString("\n")
|
||||
}
|
||||
reply(s, i, clip(b.String(), 1950))
|
||||
case "joingate":
|
||||
if len(subcmd.Options) == 0 {
|
||||
return true
|
||||
|
||||
Reference in new issue
Block a user