added basic plugin system

This commit is contained in:
2024-04-14 20:56:05 +02:00
parent bc4ada155b
commit 8600bda9bc
5 changed files with 35 additions and 22 deletions

View File

@@ -1,23 +1,22 @@
package main
import (
"github.com/disgoorg/disgo/bot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/vaporvee/acecore/struct_cmd"
)
var Plugin = &struct_cmd.Plugin{
Register: func(client bot.Client, commands *[]struct_cmd.Command) error {
*commands = append(*commands, struct_cmd.Command{
Name: "testplugin",
Commands: []struct_cmd.Command{
{
Definition: discord.SlashCommandCreate{
Name: "TESTPLUGIN",
Description: "TESTPLUGIN",
Name: "testplugincommand",
Description: "Tesing if plugins work",
},
Interact: func(e *events.ApplicationCommandInteractionCreate) {
e.CreateMessage(discord.NewMessageCreateBuilder().SetContent("TEST").SetEphemeral(true).Build())
e.CreateMessage(discord.NewMessageCreateBuilder().SetContent("Plugins are working!").SetEphemeral(true).Build())
},
})
return nil
},
},
}