Rename tgapi request structs

Add MaybeInaccessibleMessage tests and godoc
Update wiki and Bot API docs for the new naming
This commit is contained in:
2026-04-06 16:06:57 +03:00
parent d55f58c092
commit 83bcab6415
40 changed files with 1946 additions and 914 deletions
+4 -4
View File
@@ -112,7 +112,7 @@ func (bot *Bot[T]) AutoGenerateCommands() error {
}
// Clear existing commands to avoid duplication or stale entries
_, err := bot.api.DeleteMyCommands(tgapi.DeleteMyCommandsP{})
_, err := bot.api.DeleteMyCommands(tgapi.DeleteMyCommands{})
if err != nil {
return fmt.Errorf("failed to delete existing commands: %w", err)
}
@@ -125,7 +125,7 @@ func (bot *Bot[T]) AutoGenerateCommands() error {
}
for _, scope := range scopes {
_, err = bot.api.SetMyCommands(tgapi.SetMyCommandsP{
_, err = bot.api.SetMyCommands(tgapi.SetMyCommands{
Commands: commands,
Scope: scope,
})
@@ -159,12 +159,12 @@ func (bot *Bot[T]) AutoGenerateCommandsForScope(scope *tgapi.BotCommandScope) er
return ErrTooManyCommands
}
_, err := bot.api.DeleteMyCommands(tgapi.DeleteMyCommandsP{Scope: scope})
_, err := bot.api.DeleteMyCommands(tgapi.DeleteMyCommands{Scope: scope})
if err != nil {
return fmt.Errorf("failed to delete existing commands: %w", err)
}
_, err = bot.api.SetMyCommands(tgapi.SetMyCommandsP{
_, err = bot.api.SetMyCommands(tgapi.SetMyCommands{
Commands: commands,
Scope: scope,
})