-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
help.go
175 lines (169 loc) · 7.5 KB
/
help.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
package main
import (
"fmt"
"github.com/MadLadSquad/discordgo"
)
var (
footerTranslations = map[discordgo.Locale]string{
discordgo.EnglishGB: "Message delivered using UntitledTechnology",
discordgo.EnglishUS: "Message delivered using UntitledTechnology",
discordgo.Bulgarian: "Това съобщение стига до вас, благодарение на Untitled технологии",
discordgo.ChineseCN: "Message delivered using UntitledTechnology",
discordgo.ChineseTW: "Message delivered using UntitledTechnology",
discordgo.Croatian: "Message delivered using UntitledTechnology",
discordgo.Czech: "Message delivered using UntitledTechnology",
discordgo.Danish: "Message delivered using UntitledTechnology",
discordgo.Dutch: "Message delivered using UntitledTechnology",
discordgo.Finnish: "Message delivered using UntitledTechnology",
discordgo.French: "Message delivered using UntitledTechnology",
discordgo.German: "Message delivered using UntitledTechnology",
discordgo.Greek: "Message delivered using UntitledTechnology",
discordgo.Hungarian: "Message delivered using UntitledTechnology",
discordgo.Italian: "Message delivered using UntitledTechnology",
discordgo.Japanese: "Message delivered using UntitledTechnology",
discordgo.Korean: "Message delivered using UntitledTechnology",
discordgo.Lithuanian: "Message delivered using UntitledTechnology",
discordgo.Norwegian: "Message delivered using UntitledTechnology",
discordgo.Polish: "Message delivered using UntitledTechnology",
discordgo.PortugueseBR: "Message delivered using UntitledTechnology",
discordgo.Romanian: "Message delivered using UntitledTechnology",
discordgo.Russian: "Message delivered using UntitledTechnology",
discordgo.SpanishES: "Message delivered using UntitledTechnology",
discordgo.Swedish: "Message delivered using UntitledTechnology",
discordgo.Ukrainian: "Message delivered using UntitledTechnology",
discordgo.Hindi: "Message delivered using UntitledTechnology",
discordgo.Thai: "Message delivered using UntitledTechnology",
discordgo.Turkish: "Message delivered using UntitledTechnology",
discordgo.Vietnamese: "Message delivered using UntitledTechnology",
discordgo.Unknown: "Message delivered using UntitledTechnology",
}
)
func createInvite(s *discordgo.Session) {
command := &discordgo.ApplicationCommand{
Name: "invite",
Type: discordgo.ChatApplicationCommand,
Description: "Returns a link for inviting the bot",
NameLocalizations: &map[discordgo.Locale]string{
discordgo.EnglishGB: "invite",
discordgo.EnglishUS: "invite",
discordgo.Bulgarian: "покани",
discordgo.ChineseCN: "邀请",
discordgo.ChineseTW: "邀請",
discordgo.Croatian: "pozovi",
discordgo.Czech: "pozvat",
discordgo.Danish: "inviter",
discordgo.Dutch: "uitnodigen",
discordgo.Finnish: "kutsu",
discordgo.French: "inviter",
discordgo.German: "einladen",
discordgo.Greek: "προσκάλεσε",
discordgo.Hungarian: "meghívása",
discordgo.Italian: "invita",
discordgo.Japanese: "招待",
discordgo.Korean: "초대하기",
discordgo.Lithuanian: "kviesti",
discordgo.Norwegian: "inviter",
discordgo.Polish: "zaproś",
discordgo.PortugueseBR: "convidar",
discordgo.Romanian: "invită",
discordgo.Russian: "пригласить",
discordgo.SpanishES: "invitar",
discordgo.Swedish: "bjud",
discordgo.Ukrainian: "запросити",
},
DescriptionLocalizations: &map[discordgo.Locale]string{
discordgo.EnglishGB: "Returns a link for inviting the bot",
discordgo.EnglishUS: "Returns a link for inviting the bot",
discordgo.Bulgarian: "Дава линк за покана на бота в друг сървър",
},
}
_, err := s.ApplicationCommandCreate(s.State.User.ID, "", command)
if err != nil {
fmt.Println(err)
}
}
func invite(s *discordgo.Session, m *discordgo.InteractionCreate) {
//embedStrings := []string{"Invite", "Use this link", "Message delivered using UntitledTechnology"}
embedStrings := []map[discordgo.Locale]string{
{
discordgo.EnglishGB: "Invite",
discordgo.EnglishUS: "Invite",
discordgo.Bulgarian: "Покани",
discordgo.ChineseCN: "邀请",
discordgo.ChineseTW: "邀請",
discordgo.Croatian: "Pozovi",
discordgo.Czech: "Pozvat",
discordgo.Danish: "Inviter",
discordgo.Dutch: "Uitnodigen",
discordgo.Finnish: "Kutsu",
discordgo.French: "Inviter",
discordgo.German: "Einladen",
discordgo.Greek: "Пροσκάλεσε",
discordgo.Hungarian: "Meghívása",
discordgo.Italian: "Invita",
discordgo.Japanese: "招待",
discordgo.Korean: "초대하기",
discordgo.Lithuanian: "Kviesti",
discordgo.Norwegian: "Inviter",
discordgo.Polish: "Zaproś",
discordgo.PortugueseBR: "Convidar",
discordgo.Romanian: "Invită",
discordgo.Russian: "Пригласить",
discordgo.SpanishES: "Invitar",
discordgo.Swedish: "Bjud",
discordgo.Ukrainian: "Запросити",
discordgo.Hindi: "Invite",
discordgo.Thai: "Invite",
discordgo.Turkish: "Invite",
discordgo.Vietnamese: "Invite",
discordgo.Unknown: "Invite",
},
{
discordgo.EnglishGB: "Use this link",
discordgo.EnglishUS: "Use this link",
discordgo.Bulgarian: "Ползвайте този линк",
discordgo.ChineseCN: "Use this link",
discordgo.ChineseTW: "Use this link",
discordgo.Croatian: "Use this link",
discordgo.Czech: "Use this link",
discordgo.Danish: "Use this link",
discordgo.Dutch: "Use this link",
discordgo.Finnish: "Use this link",
discordgo.French: "Use this link",
discordgo.German: "Use this link",
discordgo.Greek: "Use this link",
discordgo.Hungarian: "Use this link",
discordgo.Italian: "Use this link",
discordgo.Japanese: "Use this link",
discordgo.Korean: "Use this link",
discordgo.Lithuanian: "Use this link",
discordgo.Norwegian: "Use this link",
discordgo.Polish: "Use this link",
discordgo.PortugueseBR: "Use this link",
discordgo.Romanian: "Use this link",
discordgo.Russian: "Use this link",
discordgo.SpanishES: "Use this link",
discordgo.Swedish: "Use this link",
discordgo.Ukrainian: "Use this link",
discordgo.Hindi: "Use this link",
discordgo.Thai: "Use this link",
discordgo.Turkish: "Use this link",
discordgo.Vietnamese: "Use this link",
discordgo.Unknown: "Use this link",
},
}
embed := NewEmbed().
SetTitle(embedStrings[0][m.Locale]).
AddField(embedStrings[1][m.Locale], "https://discord.com/oauth2/authorize?client_id=697420452712284202&scope=bot&permissions=2134207679").
SetFooter(footerTranslations[m.Locale], "https://avatars.githubusercontent.com/u/66491677?s=400&u=07d8dd94266f97e22ee5bd96aebb6a5f9190b4ec&v=4").
SetColor(0xf1c40f).MessageEmbed
_ = s.InteractionRespond(m.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{
TTS: false,
Content: "",
Flags: discordgo.MessageFlagsEphemeral,
Embeds: []*discordgo.MessageEmbed{embed},
},
})
}