test cmd
This commit is contained in:
@@ -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)
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user