Files
FernandoJVideira 2b14079e50 feat: add moderation commands and update README
- Introduced a new set of moderation commands including `/moderation purge`, `/moderation timeout`, `/moderation kick`, `/moderation ban`, `/moderation unban`, `/moderation untimeout`, and `/moderation slowmode`.
- Updated README to include details about the new moderation features and commands.
- Enhanced help command to display moderation tools and their usage.
2026-03-18 13:00:30 +00:00

80 lines
2.2 KiB
Go

package commands
import (
"velox-bot/internal/commands/config"
"velox-bot/internal/commands/fun"
"velox-bot/internal/commands/help"
cmdlevel "velox-bot/internal/commands/level"
"velox-bot/internal/commands/meeting"
"velox-bot/internal/commands/moderation"
cmdmusic "velox-bot/internal/commands/music"
"velox-bot/internal/commands/projects"
"velox-bot/internal/commands/schedule"
"velox-bot/internal/commands/timezone"
"velox-bot/internal/music"
"github.com/bwmarrin/discordgo"
)
var AllCommands = []*discordgo.ApplicationCommand{
fun.Ping,
fun.Joke,
fun.Coinflip,
fun.Dice,
fun.Rps,
fun.RpsStats,
fun.RpsLeaderboard,
help.Help,
cmdlevel.Slvl,
cmdlevel.Rank,
cmdlevel.Leaderboard,
cmdlevel.Rewards,
cmdmusic.Play,
cmdmusic.Queue,
cmdmusic.Volume,
meeting.Meeting,
moderation.Moderation,
timezone.Timezone,
schedule.Schedule,
projects.Projects,
config.Config,
}
var handlers = map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate){
"ping": fun.PingHandler,
"joke": fun.JokeHandler,
"coinflip": fun.CoinflipHandler,
"dice": fun.DiceHandler,
"rps": fun.RpsHandler,
"rpsstats": fun.RpsStatsHandler,
"rpsleaderboard": fun.RpsLeaderboardHandler,
"help": help.HelpHandler,
"slvl": cmdlevel.SlvlHandler,
"rank": cmdlevel.RankHandler,
"leaderboard": cmdlevel.LeaderboardHandler,
"rewards": cmdlevel.RewardsHandler,
"meeting": meeting.MeetingHandler,
"moderation": moderation.ModerationHandler,
"timezone": timezone.TimezoneHandler,
"schedule": schedule.ScheduleHandler,
"projects": projects.ProjectsHandler,
"play": cmdmusic.PlayHandler,
"queue": cmdmusic.QueueHandler,
"volume": cmdmusic.VolumeHandler,
"config": config.ConfigHandler,
}
func HandleInteraction(s *discordgo.Session, i *discordgo.InteractionCreate) {
switch i.Type {
case discordgo.InteractionApplicationCommand:
if h, ok := handlers[i.ApplicationCommandData().Name]; ok {
h(s, i)
}
case discordgo.InteractionMessageComponent:
data := i.MessageComponentData()
if len(data.CustomID) >= 6 && data.CustomID[:6] == "music:" {
music.HandleComponent(s, i)
}
}
}