/
bug.go
73 lines (61 loc) · 1.94 KB
/
bug.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
package slashcommands
import (
"github.com/bwmarrin/discordgo"
"github.com/zekroTJA/shinpuru/internal/services/permissions"
"github.com/zekroTJA/shinpuru/internal/util/static"
"github.com/zekrotja/ken"
)
type Bug struct {
ken.EphemeralCommand
}
var (
_ ken.SlashCommand = (*Bug)(nil)
_ permissions.PermCommand = (*Bug)(nil)
)
func (c *Bug) Name() string {
return "bug"
}
func (c *Bug) Description() string {
return "Get information how to submit a bug report or feature request."
}
func (c *Bug) Version() string {
return "1.0.0"
}
func (c *Bug) Type() discordgo.ApplicationCommandType {
return discordgo.ChatApplicationCommand
}
func (c *Bug) Options() []*discordgo.ApplicationCommandOption {
return []*discordgo.ApplicationCommandOption{}
}
func (c *Bug) Domain() string {
return "sp.etc.bug"
}
func (c *Bug) SubDomains() []permissions.SubPermission {
return nil
}
func (c *Bug) Run(ctx ken.Context) (err error) {
emb := &discordgo.MessageEmbed{
Color: static.ColorEmbedDefault,
Title: "How to report a bug or request a feature",
Fields: []*discordgo.MessageEmbedField{
{
Name: "GitHub Issue",
Value: "You can submit an issue by using the GitHub Issue tracker. " +
"\n*For that, you will need a GitHub account.*:\n" +
":link: [**GitHub Issues**](https://github.com/zekroTJA/shinpuru/issues/new/choose)",
},
{
Name: "Google Forms",
Value: "Alternatively, you can also submit an issue by using the following form: " +
"\n*This will be transformed into an issue on GitHub later.*:\n" +
":link: [**Google Form**](https://docs.google.com/forms/d/e/1FAIpQLScKnY2FUDqmLVg2TjdBqSAyL-LlD55y7h5JcqsT887KwLPkIg/viewform?usp=sf_link)",
},
{
Name: "Bug Hunters",
Value: "Much :heart: to all [**bug hunters**](https://github.com/zekroTJA/shinpuru/blob/dev/bughunters.md).",
},
},
}
err = ctx.RespondEmbed(emb)
return
}