mirror of
https://github.com/Fluffy-Bean/Lynxie.git
synced 2025-05-14 08:02:17 +00:00
Remove revisions
This commit is contained in:
parent
d205cffca1
commit
fa6bf5ddb8
1 changed files with 0 additions and 15 deletions
|
@ -18,8 +18,6 @@ func RegisterDebugCommands(a *app.App) {
|
||||||
|
|
||||||
func registerDebug(a *app.App) app.Callback {
|
func registerDebug(a *app.App) app.Callback {
|
||||||
return func(h *app.Handler, args []string) app.Error {
|
return func(h *app.Handler, args []string) app.Error {
|
||||||
modified := false
|
|
||||||
revision := "-"
|
|
||||||
buildTags := "-"
|
buildTags := "-"
|
||||||
goVersion := strings.TrimPrefix(runtime.Version(), "go")
|
goVersion := strings.TrimPrefix(runtime.Version(), "go")
|
||||||
gcCount := runtime.MemStats{}.NumGC
|
gcCount := runtime.MemStats{}.NumGC
|
||||||
|
@ -29,28 +27,15 @@ func registerDebug(a *app.App) app.Callback {
|
||||||
info, _ := debug.ReadBuildInfo()
|
info, _ := debug.ReadBuildInfo()
|
||||||
for _, setting := range info.Settings {
|
for _, setting := range info.Settings {
|
||||||
switch setting.Key {
|
switch setting.Key {
|
||||||
case "vcs.revision":
|
|
||||||
revision = setting.Value
|
|
||||||
case "vcs.modified":
|
|
||||||
modified = setting.Value == "true"
|
|
||||||
case "-tags":
|
case "-tags":
|
||||||
buildTags = strings.ReplaceAll(setting.Value, ",", " ")
|
buildTags = strings.ReplaceAll(setting.Value, ",", " ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if modified {
|
|
||||||
revision += " (modified)"
|
|
||||||
}
|
|
||||||
|
|
||||||
h.Session.ChannelMessageSendComplex(h.Message.ChannelID, &discordgo.MessageSend{
|
h.Session.ChannelMessageSendComplex(h.Message.ChannelID, &discordgo.MessageSend{
|
||||||
Embed: &discordgo.MessageEmbed{
|
Embed: &discordgo.MessageEmbed{
|
||||||
Title: "Lynxie",
|
Title: "Lynxie",
|
||||||
Fields: []*discordgo.MessageEmbedField{
|
Fields: []*discordgo.MessageEmbedField{
|
||||||
{
|
|
||||||
Name: "Revision",
|
|
||||||
Value: revision,
|
|
||||||
Inline: false,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "Build Tags",
|
Name: "Build Tags",
|
||||||
Value: buildTags,
|
Value: buildTags,
|
||||||
|
|
Loading…
Add table
Reference in a new issue