This commit is contained in:
mimu
2022-10-09 07:32:56 +02:00
commit 7061028af3
6 changed files with 98 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
package commands
import tempest "github.com/Amatsagu/Tempest"
var Hello tempest.Command = tempest.Command{
Name: "hello",
Description: "Some test command",
Options: []tempest.Option{
{
Name: "user",
Description: "user to greet",
Type: tempest.OPTION_USER,
},
},
SlashCommandHandler: func(itx tempest.CommandInteraction) {
raw, available := itx.GetOptionValue("user")
if available {
user, err := itx.Client.FetchUser(tempest.StringToSnowflake(raw.(string)))
if err != nil {
itx.SendLinearReply(err.Error(), false)
}
itx.SendLinearReply("Hello " + user.Tag(), false)
} else {
itx.SendLinearReply("Hello " + itx.Member.User.Tag(), false)
}
},
}
+12
View File
@@ -0,0 +1,12 @@
package commands
import tempest "github.com/Amatsagu/Tempest"
var Pinned tempest.Command = tempest.Command{
Name: "pinned",
Description: "will show a random pinned message",
Options: []tempest.Option{},
SlashCommandHandler: func(itx tempest.CommandInteraction) {
},
}