Skip to content

Commit 1350cbd

Browse files
committed
fix: NewChatKey() properly validates chatID
1 parent aa41047 commit 1350cbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

botsfwmodels/chat_key.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ func NewChatKey(botID, chatID string) ChatKey {
77
if botID == "" {
88
panic("botID is required, got empty string")
99
}
10-
if botID == "" {
10+
if chatID == "" {
1111
panic("chatID is required, got empty string")
1212
}
1313
return ChatKey{BotID: botID, ChatID: chatID}
1414
}
1515

16-
// ChatKey is a key for a chat that consist of bot ID and chat ID.
16+
// ChatKey is a key for a chat that consists of bot ID and chat ID.
1717
type ChatKey struct {
1818
// BotID an id of a bot that owns this chat
1919
BotID string

0 commit comments

Comments
 (0)