Skip to content

Commit b4950a0

Browse files
committed
Update golang and tempest versions
Library authors try not to introduce breaking changes in patch versions challege (impossible)
1 parent 0da444d commit b4950a0

8 files changed

Lines changed: 36 additions & 34 deletions

File tree

commands/bugcheck.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
tempest "github.com/Amatsagu/Tempest"
7+
tempest "github.com/amatsagu/tempest"
88
"github.com/dhrdlicka/errorbot/repo"
99
)
1010

@@ -44,7 +44,7 @@ func handleBugCheck(itx *tempest.CommandInteraction) {
4444
embed := tempest.Embed{
4545
Title: match.Name,
4646
Description: match.Description,
47-
Fields: []*tempest.EmbedField{
47+
Fields: []tempest.EmbedField{
4848
{
4949
Name: "Bugcheck code",
5050
Value: fmt.Sprintf("`0x%08X`", match.Code),
@@ -60,19 +60,19 @@ func handleBugCheck(itx *tempest.CommandInteraction) {
6060
}
6161

6262
if len(parameters) < 1024 {
63-
embed.Fields = append(embed.Fields, &tempest.EmbedField{
63+
embed.Fields = append(embed.Fields, tempest.EmbedField{
6464
Name: "Parameters",
6565
Value: parameters,
6666
})
6767
}
6868
}
6969

70-
embed.Fields = append(embed.Fields, &tempest.EmbedField{
70+
embed.Fields = append(embed.Fields, tempest.EmbedField{
7171
Name: "Documentation",
7272
Value: match.URL,
7373
})
7474

75-
response.Embeds = append(response.Embeds, &embed)
75+
response.Embeds = append(response.Embeds, embed)
7676

7777
} else {
7878
response.Content = fmt.Sprintf("Could not find bug check code %s (`0x%08X`)", value, codes[0])

commands/error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log/slog"
66
"strings"
77

8-
tempest "github.com/Amatsagu/Tempest"
8+
tempest "github.com/amatsagu/tempest"
99
"github.com/dhrdlicka/errorbot/repo"
1010
)
1111

@@ -57,7 +57,7 @@ func handleError(itx *tempest.CommandInteraction) {
5757
if len(matches) > 0 {
5858
found = true
5959

60-
response.Embeds = append(response.Embeds, &tempest.Embed{
60+
response.Embeds = append(response.Embeds, tempest.Embed{
6161
Title: fmt.Sprintf("Possible %s codes", errorRepo.name),
6262
Description: formatResults(matches),
6363
})

commands/hello.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package commands
22

3-
import tempest "github.com/Amatsagu/Tempest"
3+
import tempest "github.com/amatsagu/tempest"
44

55
var HelloCommand = tempest.Command{
66
Name: "hello",

commands/hresult.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"log/slog"
66

7-
tempest "github.com/Amatsagu/Tempest"
7+
tempest "github.com/amatsagu/tempest"
88
"github.com/dhrdlicka/errorbot/repo"
99
"github.com/dhrdlicka/errorbot/winerror"
1010
)
@@ -61,12 +61,12 @@ func hResultSeverityToString(severity bool) string {
6161
}
6262
}
6363

64-
func createHResultEmbed(hResult repo.ErrorInfo) *tempest.Embed {
65-
return &tempest.Embed{
64+
func createHResultEmbed(hResult repo.ErrorInfo) tempest.Embed {
65+
return tempest.Embed{
6666
Title: hResult.Name,
6767
Description: hResult.Description,
6868
Fields: append(
69-
[]*tempest.EmbedField{
69+
[]tempest.EmbedField{
7070
{
7171
Name: "HRESULT code",
7272
Value: fmt.Sprintf("`0x%08X` (%d)", hResult.Code, hResult.Code),
@@ -75,10 +75,10 @@ func createHResultEmbed(hResult repo.ErrorInfo) *tempest.Embed {
7575
}
7676
}
7777

78-
func createUnknownHResultEmbed(code uint32) *tempest.Embed {
79-
return &tempest.Embed{
78+
func createUnknownHResultEmbed(code uint32) tempest.Embed {
79+
return tempest.Embed{
8080
Fields: append(
81-
[]*tempest.EmbedField{
81+
[]tempest.EmbedField{
8282
{
8383
Name: "HRESULT code",
8484
Value: fmt.Sprintf("`0x%08X` (%d)", code, code),
@@ -87,7 +87,7 @@ func createUnknownHResultEmbed(code uint32) *tempest.Embed {
8787
}
8888
}
8989

90-
func createHResultEmbedFields(hResult winerror.HResult) []*tempest.EmbedField {
90+
func createHResultEmbedFields(hResult winerror.HResult) []tempest.EmbedField {
9191
if hResult.N() {
9292
// mapped NTSTATUS
9393
return createNTStatusEmbedFields(winerror.NTStatus(hResult))
@@ -99,7 +99,7 @@ func createHResultEmbedFields(hResult winerror.HResult) []*tempest.EmbedField {
9999
facility = fmt.Sprintf("%s (%s)", facility_name, facility)
100100
}
101101

102-
return []*tempest.EmbedField{
102+
return []tempest.EmbedField{
103103
{
104104
Name: "Severity",
105105
Value: fmt.Sprintf("%s (%d)", hResultSeverityToString(hResult.S()), boolToInt(hResult.S())),

commands/ntstatus.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"log/slog"
66

7-
tempest "github.com/Amatsagu/Tempest"
7+
tempest "github.com/amatsagu/tempest"
88
"github.com/dhrdlicka/errorbot/repo"
99
"github.com/dhrdlicka/errorbot/winerror"
1010
)
@@ -68,12 +68,12 @@ func ntStatusSeverityToString(severity uint8) string {
6868
return ""
6969
}
7070

71-
func createNTStatusEmbed(ntStatus repo.ErrorInfo) *tempest.Embed {
72-
return &tempest.Embed{
71+
func createNTStatusEmbed(ntStatus repo.ErrorInfo) tempest.Embed {
72+
return tempest.Embed{
7373
Title: ntStatus.Name,
7474
Description: ntStatus.Description,
7575
Fields: append(
76-
[]*tempest.EmbedField{
76+
[]tempest.EmbedField{
7777
{
7878
Name: "NTSTATUS code",
7979
Value: fmt.Sprintf("`0x%08X` (%d)", ntStatus.Code, ntStatus.Code),
@@ -82,10 +82,10 @@ func createNTStatusEmbed(ntStatus repo.ErrorInfo) *tempest.Embed {
8282
}
8383
}
8484

85-
func createUnknownNTStatusEmbed(code uint32) *tempest.Embed {
86-
return &tempest.Embed{
85+
func createUnknownNTStatusEmbed(code uint32) tempest.Embed {
86+
return tempest.Embed{
8787
Fields: append(
88-
[]*tempest.EmbedField{
88+
[]tempest.EmbedField{
8989
{
9090
Name: "NTSTATUS code",
9191
Value: fmt.Sprintf("`0x%08X` (%d)", code, code),
@@ -94,14 +94,14 @@ func createUnknownNTStatusEmbed(code uint32) *tempest.Embed {
9494
}
9595
}
9696

97-
func createNTStatusEmbedFields(status winerror.NTStatus) []*tempest.EmbedField {
97+
func createNTStatusEmbedFields(status winerror.NTStatus) []tempest.EmbedField {
9898
facility := fmt.Sprintf("%d", status.Facility())
9999

100100
if facility_name, ok := repoInstance.NTStatus.Facilities[status.Facility()]; ok {
101101
facility = fmt.Sprintf("%s (%s)", facility_name, facility)
102102
}
103103

104-
return []*tempest.EmbedField{
104+
return []tempest.EmbedField{
105105
{
106106
Name: "Severity",
107107
Value: fmt.Sprintf("%s (%d)", ntStatusSeverityToString(status.Sev()), status.Sev()),

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
module github.com/dhrdlicka/errorbot
22

3-
go 1.22.6
3+
go 1.24.0
44

5-
require github.com/Amatsagu/Tempest v1.2.0
5+
toolchain go1.24.3
6+
7+
require github.com/amatsagu/tempest v1.2.3
68

79
require gopkg.in/yaml.v3 v3.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/Amatsagu/Tempest v1.2.0 h1:beLRJNona64e1putLBpbd7PrVZnBSeBTG8GD/uyjPak=
2-
github.com/Amatsagu/Tempest v1.2.0/go.mod h1:6pJb/I5+sg0g0bc78zRPVh7G5s1pL7FxCzGDoHlVugE=
1+
github.com/amatsagu/tempest v1.2.3 h1:VpbXmhvpytBZkYrmShxEG9mOz/lQ5nj6AoCdzXE+ggc=
2+
github.com/amatsagu/tempest v1.2.3/go.mod h1:NuRaGM2wOabFv4Z0IDCKkdXQcJ6WrqwVrk2CUPcJbmk=
33
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
44
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
55
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"net/http"
66
"os"
77

8-
tempest "github.com/Amatsagu/Tempest"
8+
tempest "github.com/amatsagu/tempest"
99
"github.com/dhrdlicka/errorbot/commands"
1010
)
1111

@@ -18,7 +18,7 @@ func main() {
1818

1919
client := tempest.NewClient(tempest.ClientOptions{
2020
PublicKey: os.Getenv("DISCORD_PUBLIC_KEY"),
21-
Rest: tempest.NewRestClient(os.Getenv("DISCORD_BOT_TOKEN")),
21+
Token: os.Getenv("DISCORD_BOT_TOKEN"),
2222
})
2323

2424
//client.RegisterCommand(commands.HelloCommand)
@@ -27,13 +27,13 @@ func main() {
2727
client.RegisterCommand(commands.NTStatusCommand)
2828
client.RegisterCommand(commands.HResultCommand)
2929

30-
err = client.SyncCommands(nil, nil, false)
30+
err = client.SyncCommandsWithDiscord(nil, nil, false)
3131

3232
if err != nil {
3333
log.Fatal(err)
3434
}
3535

36-
http.HandleFunc("POST /interactions", client.HandleDiscordRequest)
36+
http.HandleFunc("POST /interactions", client.DiscordRequestHandler)
3737

3838
log.Fatal(http.ListenAndServe(":"+os.Getenv("PORT"), nil))
3939
}

0 commit comments

Comments
 (0)