finished plugin system base

This commit is contained in:
2024-04-15 18:17:12 +02:00
parent 31e96c80f4
commit 077054109f
51 changed files with 2218 additions and 2160 deletions

30
shared/main.go Normal file
View File

@@ -0,0 +1,30 @@
package shared
import (
"database/sql"
"github.com/disgoorg/disgo/bot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
)
type Command struct {
Ready func(e *events.Ready)
Definition discord.ApplicationCommandCreate
Interact func(e *events.ApplicationCommandInteractionCreate)
Autocomplete func(e *events.AutocompleteInteractionCreate)
ComponentInteract func(e *events.ComponentInteractionCreate)
ModalSubmit func(e *events.ModalSubmitInteractionCreate)
ComponentIDs []string
ModalIDs []string
DynamicModalIDs func() []string
DynamicComponentIDs func() []string
}
type Plugin struct {
Name string
Init func(d *sql.DB) error
Commands []Command
}
var BotConfigs []bot.ConfigOpt