-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Packages, Add Status Command, and Bugfixes (!8)
Co-authored-by: Layla Manley <[email protected]> Reviewed-on: https://gitea.layla.gg/layla/birdbot/pulls/8
- Loading branch information
Showing
9 changed files
with
120 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
module github.com/yeslayla/birdbot | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
toolchain go1.21.5 | ||
|
||
require ( | ||
github.com/bwmarrin/discordgo v0.27.1 | ||
github.com/ilyakaznacheev/cleanenv v1.4.2 | ||
github.com/bwmarrin/discordgo v0.27.2-0.20240104191117-afc57886f91a | ||
github.com/ilyakaznacheev/cleanenv v1.5.0 | ||
github.com/mattn/go-mastodon v0.0.6 | ||
github.com/mattn/go-sqlite3 v1.14.17 | ||
github.com/rubenv/sql-migrate v1.4.0 | ||
github.com/mattn/go-sqlite3 v1.14.19 | ||
github.com/rubenv/sql-migrate v1.6.0 | ||
github.com/stretchr/testify v1.8.4 | ||
github.com/yeslayla/birdbot-common v0.1.0 | ||
) | ||
|
||
require ( | ||
github.com/BurntSushi/toml v1.3.2 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/go-gorp/gorp/v3 v3.1.0 // indirect | ||
github.com/gorilla/websocket v1.5.0 // indirect | ||
github.com/gorilla/websocket v1.5.1 // indirect | ||
github.com/joho/godotenv v1.5.1 // indirect | ||
github.com/magefile/mage v1.14.0 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/stretchr/objx v0.5.0 // indirect | ||
github.com/stretchr/objx v0.5.1 // indirect | ||
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect | ||
github.com/yeslayla/birdbot-common v0.1.0 // indirect | ||
golang.org/x/crypto v0.10.0 // indirect | ||
golang.org/x/sys v0.9.0 // indirect | ||
golang.org/x/crypto v0.18.0 // indirect | ||
golang.org/x/net v0.20.0 // indirect | ||
golang.org/x/sys v0.16.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package modules | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/yeslayla/birdbot-common/common" | ||
) | ||
|
||
type statusModule struct { | ||
portalURL string | ||
} | ||
|
||
// NewStatusComponent creates a new component | ||
func NewStatusComponent(portalURL string) common.Module { | ||
m := &statusModule{ | ||
portalURL: portalURL, | ||
} | ||
|
||
return m | ||
} | ||
|
||
func (c *statusModule) Initialize(birdbot common.ModuleManager) error { | ||
birdbot.RegisterCommand("status", common.ChatCommandConfiguration{ | ||
Description: "Gets the current status of the bot", | ||
EphemeralResponse: false, | ||
}, func(user common.User, args map[string]any) string { | ||
|
||
return fmt.Sprintf("The bot is currently OK.\nSee Status Portal for more information: %s", c.portalURL) | ||
}) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters