Join Gate (account age, avatar, advertising and username filters, bot checks), raid detection with invite pausing, anti-nuke quarantine of admins who mass delete, manual and automatic lockdowns, a decaying heat score against spam, role and channel snapshots with restore, and alert DMs to the owner and trusted users. Everything that weakens protection is limited to the owner and the trusted list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
172 lines
6.8 KiB
Go
172 lines
6.8 KiB
Go
package help
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
)
|
|
|
|
var Help = &discordgo.ApplicationCommand{
|
|
Name: "help",
|
|
Description: "Get help with the bot",
|
|
}
|
|
|
|
func HelpHandler(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
|
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
|
Data: &discordgo.InteractionResponseData{
|
|
Content: "Check your DMs for help.",
|
|
Flags: discordgo.MessageFlagsEphemeral,
|
|
},
|
|
})
|
|
|
|
userID := ""
|
|
|
|
// check if command is run in a guild
|
|
if i.Member != nil {
|
|
userID = i.Member.User.ID
|
|
} else {
|
|
userID = i.Interaction.User.ID
|
|
}
|
|
|
|
dmChannel, err := s.UserChannelCreate(userID)
|
|
if err != nil {
|
|
log.Printf("Error creating DM channel: %v", err)
|
|
return
|
|
}
|
|
|
|
author := discordgo.MessageEmbedAuthor{
|
|
Name: "Velox Bot",
|
|
URL: "https://gitea.fernandovideira.com/FernandoJVideira/velox-bot",
|
|
}
|
|
|
|
embed := &discordgo.MessageEmbed{
|
|
Title: "Velox Bot Help",
|
|
Description: "Command reference. Some commands require server permissions or roles.",
|
|
Color: 0xFFA500,
|
|
Fields: []*discordgo.MessageEmbedField{
|
|
{
|
|
Name: "Fun",
|
|
Value: "" +
|
|
"`/ping` — Pong!\n" +
|
|
"`/joke [type]` — Random joke (optional category)\n" +
|
|
"`/coinflip` — Flip a coin\n" +
|
|
"`/dice <expr>` — Roll dice (e.g. `d20`, `2d20+1`, `2#d20+1`)\n" +
|
|
"`/rps <hand>` — Rock Paper Scissors (server only)\n" +
|
|
"`/rpsstats` — Your RPS score (server only)\n" +
|
|
"`/rpsleaderboard` — Top RPS scores (server only)",
|
|
},
|
|
{
|
|
Name: "Music (requires **DJ** role)",
|
|
Value: "" +
|
|
"`/play <query>` — Play a song (search or URL)\n" +
|
|
"`/queue` — Show the current queue\n" +
|
|
"`/volume <0-150>` — Set playback volume",
|
|
},
|
|
{
|
|
Name: "Scheduling (1:1 sessions)",
|
|
Value: "" +
|
|
"`/schedule create user:@someone datetime:\"YYYY-MM-DD HH:MM\" [description]` — Create a session\n" +
|
|
"`/schedule list` — List your upcoming sessions\n" +
|
|
"`/schedule reschedule id:<id> datetime:\"YYYY-MM-DD HH:MM\"` — Request a new time\n\n" +
|
|
"Invites are sent via DM; react with ✅ / ❌ / 🔁 to respond.",
|
|
},
|
|
{
|
|
Name: "Timezone",
|
|
Value: "" +
|
|
"`/timezone set <IANA>` — Set your timezone (e.g. `Europe/Lisbon`)\n" +
|
|
"`/timezone show` — Show your timezone",
|
|
},
|
|
{
|
|
Name: "Projects",
|
|
Value: "" +
|
|
"`/projects list` — List active projects\n" +
|
|
"`/projects create name:\"...\" [description]` — Create a project (**Manage Server**)\n" +
|
|
"`/projects add-helper project-id:<id> user:@someone` — Add helper (**Manage Server**)",
|
|
},
|
|
{
|
|
Name: "Tickets",
|
|
Value: "" +
|
|
"Open a ticket from the panel: you get a private thread with the staff.\n" +
|
|
"`/ticket add user:@someone` — Add someone to your ticket\n" +
|
|
"`/ticket close [reason]` — Close the ticket (opener or staff)\n" +
|
|
"`/ticket claim`, `/ticket remove user:@someone` — Staff only\n" +
|
|
"`/tickets setup`, `/tickets category add|remove|list`, `/tickets panel` — Set up (**Manage Server**)",
|
|
},
|
|
{
|
|
Name: "Security (anti-raid & anti-nuke)",
|
|
Value: "" +
|
|
"`/security status` — What's on and who is trusted\n" +
|
|
"`/security toggle` — Join Gate, raid mode, anti-nuke on/off (off: owner or trusted)\n" +
|
|
"`/security alerts`, `/security quarantine-role`, `/security release`, `/security end-raid` — Owner or trusted\n" +
|
|
"`/security trust add|remove` — Owner only\n" +
|
|
"`/security snapshot` — Save roles and channels; `/security restore` — Rebuild what a nuke deleted (owner or trusted)\n" +
|
|
"`/lockdown channel|server|joins`, `/unlock …` (unlock: owner or trusted)",
|
|
},
|
|
{
|
|
Name: "Meetings (**Manage Server**)",
|
|
Value: "" +
|
|
"`/meeting set-lobby channel:#voice` — Set voice lobby used to create meetings\n" +
|
|
"`/meeting lock` — Lock your meeting room\n" +
|
|
"`/meeting lock-private` — Lock + hide your meeting room\n" +
|
|
"`/meeting unlock` — Unlock your meeting room\n" +
|
|
"`/meeting invite user:@someone` — Allow a user to join\n" +
|
|
"`/meeting uninvite user:@someone` — Remove a user's permission",
|
|
},
|
|
{
|
|
Name: "Moderation (focused tools)",
|
|
Value: "" +
|
|
"`/moderation purge amount:<1-100>` — Delete recent messages (**Manage Messages**)\n" +
|
|
"`/moderation timeout user:@someone duration:<10m|1h|...> [reason]` — Timeout member (**Moderate Members**)\n" +
|
|
"`/moderation kick user:@someone [reason]` — Kick member (**Kick Members**)\n" +
|
|
"`/moderation ban user:@someone [delete_days] [reason]` — Ban member (**Ban Members**)\n" +
|
|
"`/moderation unban user_id:<id> [reason]` — Unban by user ID (**Ban Members**)\n" +
|
|
"`/moderation untimeout user:@someone [reason]` — Remove timeout (**Moderate Members**)\n" +
|
|
"`/moderation slowmode channel:#channel seconds:<0-21600>` — Set slowmode (**Manage Channels**)",
|
|
},
|
|
{
|
|
Name: "Leveling",
|
|
Value: "" +
|
|
"`/slvl toggle` — Enable/disable leveling (**Manage Server**)\n" +
|
|
"`/slvl set user:@someone level:<n>` — Set user level (**Manage Server**)\n" +
|
|
"`/slvl set-channel channel:#channel` — Level-up message channel (**Manage Server**)\n" +
|
|
"`/slvl set-message message:\"...\"` — Custom level-up message (**Manage Server**)\n" +
|
|
"`/slvl set-reward level:<n> role:@role` — Role rewards (**Manage Server**)\n" +
|
|
"`/rank [user]` — Your rank card (server only)\n" +
|
|
"`/leaderboard` — Top levels (server only)\n" +
|
|
"`/rewards` — List configured rewards (server only)",
|
|
},
|
|
{
|
|
Name: "Twitch live notifications (**Manage Server**)",
|
|
Value: "" +
|
|
"`/config addstreamer username:<twitch-name>` — Add a streamer\n" +
|
|
"`/config removestreamer username:<twitch-name>` — Remove a streamer\n" +
|
|
"`/config settwitchnotificationchannel channel:#channel` — Set notification channel",
|
|
},
|
|
{
|
|
Name: "Welcome / onboarding (**Manage Server**)",
|
|
Value: "" +
|
|
"`/config setwelcomechannel channel:#channel` — Channel for welcome messages\n" +
|
|
"`/config setwelcomemessage message:\"...\"` — Welcome text (supports `{user}`, `{server}`)\n" +
|
|
"`/config setwelcomedm message:\"...\"` — DM template (supports `{user}`, `{server}`)\n" +
|
|
"`/config setwelcomegif url:<image-url>` — GIF/image used in welcome embed\n" +
|
|
"`/config setdefaultrole role:@role` — Role granted to new members",
|
|
},
|
|
{
|
|
Name: "Logging (**Manage Server**)",
|
|
Value: "" +
|
|
"`/config setlogchannel channel:#channel` — Set log output channel\n" +
|
|
"`/config enablelogging` — Enable event/moderation logging\n" +
|
|
"`/config disablelogging` — Disable event/moderation logging",
|
|
},
|
|
{
|
|
Name: "Other",
|
|
Value: "`/help` — Show this help in DMs",
|
|
},
|
|
},
|
|
Author: &author,
|
|
}
|
|
|
|
s.ChannelMessageSendEmbed(dmChannel.ID, embed)
|
|
}
|