Skip to content

Commit 8ad1e04

Browse files
committed
telebot: naming, docs
1 parent 6c51ff7 commit 8ad1e04

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

bot.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ func (b *Bot) Use(middleware ...MiddlewareFunc) {
174174
//
175175
// Middleware usage:
176176
//
177-
// protected := telemw.Whitelist(ids...)
178-
// b.Handle("/ban", onBan, protected)
177+
// b.Handle("/ban", onBan, middleware.Whitelist(ids...))
179178
//
180179
func (b *Bot) Handle(endpoint interface{}, h HandlerFunc, m ...MiddlewareFunc) {
181180
if len(b.group.middleware) > 0 {

chat.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ type Chat struct {
4646
Still bool `json:"is_member,omitempty"`
4747

4848
// Returns only in getChat
49-
Bio string `json:"bio,omitempty"`
50-
Photo *ChatPhoto `json:"photo,omitempty"`
51-
HasPrivateForwards bool `json:"has_private_forwards,omitempty"`
52-
Description string `json:"description,omitempty"`
53-
InviteLink string `json:"invite_link,omitempty"`
54-
PinnedMessage *Message `json:"pinned_message,omitempty"`
55-
Permissions *Rights `json:"permissions,omitempty"`
56-
SlowMode int `json:"slow_mode_delay,omitempty"`
57-
HasProtectedContent bool `json:"has_protected_content,omitempty"`
58-
StickerSet string `json:"sticker_set_name,omitempty"`
59-
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
60-
LinkedChatID int64 `json:"linked_chat_id,omitempty"`
61-
ChatLocation *ChatLocation `json:"location,omitempty"`
49+
Bio string `json:"bio,omitempty"`
50+
Photo *ChatPhoto `json:"photo,omitempty"`
51+
Description string `json:"description,omitempty"`
52+
InviteLink string `json:"invite_link,omitempty"`
53+
PinnedMessage *Message `json:"pinned_message,omitempty"`
54+
Permissions *Rights `json:"permissions,omitempty"`
55+
SlowMode int `json:"slow_mode_delay,omitempty"`
56+
StickerSet string `json:"sticker_set_name,omitempty"`
57+
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
58+
LinkedChatID int64 `json:"linked_chat_id,omitempty"`
59+
ChatLocation *ChatLocation `json:"location,omitempty"`
60+
Private bool `json:"has_private_forwards,omitempty"`
61+
Protected bool `json:"has_protected_content,omitempty"`
6262
}
6363

6464
type ChatLocation struct {

message.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ type Message struct {
4343
// For forwarded messages, unixtime of the original message.
4444
OriginalUnixtime int `json:"forward_date"`
4545

46-
// Message is a channel post that was automatically forwarded to the connected discussion group
47-
IsAutomaticForward bool `json:"is_automatic_forward"`
46+
// Message is a channel post that was automatically forwarded to the connected discussion group.
47+
AutomaticForward bool `json:"is_automatic_forward"`
4848

4949
// For replies, ReplyTo represents the original message.
5050
//
@@ -56,11 +56,11 @@ type Message struct {
5656
// Shows through which bot the message was sent.
5757
Via *User `json:"via_bot"`
5858

59-
// (Optional) Time of last edit in Unix
59+
// (Optional) Time of last edit in Unix.
6060
LastEdit int64 `json:"edit_date"`
6161

62-
// (Optional) Message can't be forwarded
63-
HasProtectedContent bool `json:"has_protected_content,omitempty"`
62+
// (Optional) Message can't be forwarded.
63+
Protected bool `json:"has_protected_content,omitempty"`
6464

6565
// AlbumID is the unique identifier of a media message group
6666
// this message belongs to.

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type SendOptions struct {
7878
// AllowWithoutReply allows sending messages not a as reply if the replied-to message has already been deleted.
7979
AllowWithoutReply bool
8080

81-
// Protects the contents of the sent message from forwarding and saving
81+
// Protected protects the contents of the sent message from forwarding and saving
8282
Protected bool
8383
}
8484

0 commit comments

Comments
 (0)