Skip to content

Commit

Permalink
fix: error handling in versionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed May 30, 2024
1 parent 943c06d commit 84020f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/bot/versionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ import (
// versionHandler handles the /version command.
func versionHandler(b *gotgbot.Bot, ctx *ext.Context) error {
_, sendErr := b.SendMessage(ctx.EffectiveChat.Id, "Bot version: "+version, nil)
return fmt.Errorf("could not send version: %w", sendErr)
if sendErr != nil {
return fmt.Errorf("could not send version: %w", sendErr)
}
return nil
}

0 comments on commit 84020f9

Please sign in to comment.