diff --git a/commands.md b/commands.md index 1552972..2656f4b 100644 --- a/commands.md +++ b/commands.md @@ -5,14 +5,15 @@ |-------------|--------------------------------| | [Argument] | Argument is not required. | -## Demo -| Commands | Arguments | Description | -|----------|-----------|--------------------------| -| Hello | | A 'Hello World' command. | +## Admin Commands +| Commands | Arguments | Description | +|----------|-----------|----------------------------------| +| Purge | Amount | Purges a set amount of messages. | ## Utility | Commands | Arguments | Description | |----------|-----------|----------------------| | Help | [Command] | Display a help menu. | +| Ping | | Pong! | | info | | Bot info for Sonia | diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/SoniaKt/Main.kt similarity index 64% rename from src/main/kotlin/Main.kt rename to src/main/kotlin/SoniaKt/Main.kt index 0e98a9d..2881e9a 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/SoniaKt/Main.kt @@ -1,15 +1,17 @@ -package xyz.limepot +package xyz.limepot.SoniaKt import dev.kord.common.annotation.KordPreview +import dev.kord.common.entity.Permission +import dev.kord.common.entity.Permissions import dev.kord.common.entity.PresenceStatus import dev.kord.common.entity.Snowflake -import dev.kord.core.entity.GuildEmoji import dev.kord.core.entity.ReactionEmoji import dev.kord.core.event.message.MessageCreateEvent import dev.kord.gateway.DiscordPresence import dev.kord.x.emoji.Emojis import dev.kord.x.emoji.from import kotlinx.coroutines.flow.toList +import me.jakejmattson.discordkt.arguments.IntegerArg import me.jakejmattson.discordkt.commands.commands import me.jakejmattson.discordkt.dsl.bot import me.jakejmattson.discordkt.dsl.listeners @@ -43,6 +45,21 @@ fun utility() = commands("Utility") { } } +fun admin() = commands("Admin Commands", requiredPermissionLevel = Permissions(Permission.Administrator)) { + slash("Purge", "Purges a set amount of messages.") { + execute(IntegerArg("Amount")) { + val (amount) = args + respond("Deleting " + amount + " messages...") + //MessageDeleteBulk() + //GuildChannel + // Basically: + /* + Get the current channel id, a list of all message ids to be deleted (within range of supplied amount), and supply it to MessageDeleteBulk() + */ + } + } +} + // Listeners fun testListeners() = listeners { on { @@ -53,5 +70,8 @@ fun testListeners() = listeners { else if (message.content == ">:3") { message.addReaction(ReactionEmoji.Custom((Snowflake(1264301501422112839)), "Mayu Hearts", false)) } + else if (message.content == "badwordhere") { + message.delete("a") + } } }