This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fun.go
55 lines (52 loc) · 1.52 KB
/
fun.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
import (
"github.com/bwmarrin/discordgo"
)
var (
funCommands = []*discordgo.ApplicationCommand{
{
Name: "hello",
Description: "Say hello",
},
{
Name: "info",
Description: "Get information about Programm Chest",
},
}
funCommandHandlers = map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate){
"hello": func(s *discordgo.Session, i *discordgo.InteractionCreate) {
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{
Content: "Hello, I'm a bot!",
},
})
},
"info": func(s *discordgo.Session, i *discordgo.InteractionCreate) {
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{
Content: "**Information**",
Components: []discordgo.MessageComponent{
discordgo.ActionsRow{
Components: []discordgo.MessageComponent{
discordgo.Button{
Emoji: discordgo.ComponentEmoji{ID: "803156914028281856"},
Label: "Programm Chest",
Style: discordgo.LinkButton,
URL: "https://programm-chest.dev",
},
discordgo.Button{
Emoji: discordgo.ComponentEmoji{ID: "834458109480140850"},
Label: "Linwood",
Style: discordgo.LinkButton,
URL: "https://linwood.dev",
},
},
},
},
},
})
},
}
)