Skip to content

Commit 024aad5

Browse files
committed
Merge branch 'main' of github.com:dhrdlicka/errorbot
2 parents fd1a413 + 53ab31c commit 024aad5

11 files changed

Lines changed: 97 additions & 34 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gomod" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/go.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.24'
23+
24+
- name: Build
25+
run: go build -v ./...
26+
27+
- name: Test
28+
run: go test -v ./...

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2024-2025 David Hrdlička
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

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

@@ -42,7 +42,7 @@ func handleBugCheck(itx *tempest.CommandInteraction) {
4242
embed := tempest.Embed{
4343
Title: match.Name,
4444
Description: match.Description,
45-
Fields: []*tempest.EmbedField{
45+
Fields: []tempest.EmbedField{
4646
{
4747
Name: "Bugcheck code",
4848
Value: fmt.Sprintf("`0x%08X`", match.Code),
@@ -58,19 +58,19 @@ func handleBugCheck(itx *tempest.CommandInteraction) {
5858
}
5959

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

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

73-
response.Embeds = append(response.Embeds, &embed)
73+
response.Embeds = append(response.Embeds, embed)
7474

7575
} else {
7676
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=

0 commit comments

Comments
 (0)