Compare commits
1 Commits
v1.0.0-bet
...
v1.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
0574222608
|
4
bot.go
4
bot.go
@@ -277,7 +277,7 @@ func NewBot[T any](opts *BotOpts) *Bot[T] {
|
||||
if bot.username == "" {
|
||||
bot.logger.Warn("Can't get bot username. Named command handlers won't work!")
|
||||
}
|
||||
bot.logger.Infof("Authorized as %s (@%s)\n", u.FirstName, u.Username)
|
||||
bot.logger.Infof("Authorized as %s (@%s)\n", u.FirstName, Val(u.Username, "unknown"))
|
||||
|
||||
return bot
|
||||
}
|
||||
@@ -611,7 +611,7 @@ func (bot *Bot[T]) RunWithContext(ctx context.Context) {
|
||||
|
||||
for _, u := range updates {
|
||||
select {
|
||||
case bot.updateQueue <- u:
|
||||
case bot.updateQueue <- &u:
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ func (bot *Bot[T]) AutoGenerateCommands() error {
|
||||
continue
|
||||
}
|
||||
commands = append(commands, generateBotCommandForPlugin(pl)...)
|
||||
bot.logger.Debugf("Registered %d commands from plugin %s", len(pl.commands), pl.name)
|
||||
bot.logger.Debugln(fmt.Sprintf("Registered %d commands from plugin %s", len(pl.commands), pl.name))
|
||||
}
|
||||
|
||||
// Enforce Telegram's 100-command limit
|
||||
|
||||
@@ -2,15 +2,15 @@ module example/basic
|
||||
|
||||
go 1.26.1
|
||||
|
||||
require git.nix13.pw/scuroneko/laniakea v1.0.0-beta.11
|
||||
require git.nix13.pw/scuroneko/laniakea v1.0.0-beta.12
|
||||
|
||||
require (
|
||||
git.nix13.pw/scuroneko/extypes v1.2.1 // indirect
|
||||
git.nix13.pw/scuroneko/slog v1.0.2 // indirect
|
||||
github.com/alitto/pond/v2 v2.6.2 // indirect
|
||||
github.com/alitto/pond/v2 v2.7.0 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
golang.org/x/sys v0.41.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
golang.org/x/sys v0.42.0 // indirect
|
||||
golang.org/x/time v0.15.0 // indirect
|
||||
)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
git.nix13.pw/scuroneko/extypes v1.2.1 h1:IYrOjnWKL2EAuJYtYNa+luB1vBe6paE8VY/YD+5/RpQ=
|
||||
git.nix13.pw/scuroneko/extypes v1.2.1/go.mod h1:uZVs8Yo3RrYAG9dMad6qR6lsYY67t+459D9c65QAYAw=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.11 h1:bf+5B8vUL/MEmbbX6pA0Wjf0N1eIZH5/WxoSApMcXD4=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.11/go.mod h1:DZgCqOazRzoa+f/GSNuKnTB2wIZ1eJD3cGf34Qya31U=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.12 h1:IpcLF5OTZKOsYhj7AULDsDPrCUdtSnS5LgApOyMIRYU=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.12/go.mod h1:M8jwm195hzAl9bj9Bkl95WfHmWvuBX6micsdtOs/gmE=
|
||||
git.nix13.pw/scuroneko/slog v1.0.2 h1:vZyUROygxC2d5FJHUQM/30xFEHY1JT/aweDZXA4rm2g=
|
||||
git.nix13.pw/scuroneko/slog v1.0.2/go.mod h1:3Qm2wzkR5KjwOponMfG7TcGSDjmYaFqRAmLvSPTuWJI=
|
||||
github.com/alitto/pond/v2 v2.6.2 h1:Sphe40g0ILeM1pA2c2K+Th0DGU+pt0A/Kprr+WB24Pw=
|
||||
github.com/alitto/pond/v2 v2.6.2/go.mod h1:xkjYEgQ05RSpWdfSd1nM3OVv7TBhLdy7rMp3+2Nq+yE=
|
||||
github.com/alitto/pond/v2 v2.7.0 h1:c76L+yN916m/DRXjGCeUBHHu92uWnh/g1bwVk4zyyXg=
|
||||
github.com/alitto/pond/v2 v2.7.0/go.mod h1:xkjYEgQ05RSpWdfSd1nM3OVv7TBhLdy7rMp3+2Nq+yE=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
@@ -13,7 +13,7 @@ github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stg
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
|
||||
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
|
||||
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
|
||||
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
|
||||
|
||||
@@ -172,7 +172,6 @@ func (p *Plugin[T]) AddCommand(command *Command[T]) *Plugin[T] {
|
||||
// Returns the created command for further configuration.
|
||||
func (p *Plugin[T]) NewCommand(exec CommandExecutor[T], command string, args ...CommandArg) *Command[T] {
|
||||
cmd := NewCommand(exec, command, args...)
|
||||
p.AddCommand(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +224,6 @@ func (r TelegramRequest[R, P]) doRequest(ctx context.Context, api *API) (R, erro
|
||||
}
|
||||
|
||||
api.logger.Debugln("REQ", url, string(data))
|
||||
|
||||
resp, err := api.client.Do(req)
|
||||
if err != nil {
|
||||
return zero, fmt.Errorf("HTTP request failed: %w", err)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package utils
|
||||
|
||||
const (
|
||||
VersionString = "1.0.0-beta.12"
|
||||
VersionString = "1.0.0-beta.13"
|
||||
VersionMajor = 1
|
||||
VersionMinor = 0
|
||||
VersionPatch = 0
|
||||
VersionBeta = 12
|
||||
VersionBeta = 13
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user