Skip to content

Commit

Permalink
telebot: naming, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
demget committed Feb 7, 2022
1 parent 6c51ff7 commit 8ad1e04
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
3 changes: 1 addition & 2 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ func (b *Bot) Use(middleware ...MiddlewareFunc) {
//
// Middleware usage:
//
// protected := telemw.Whitelist(ids...)
// b.Handle("/ban", onBan, protected)
// b.Handle("/ban", onBan, middleware.Whitelist(ids...))
//
func (b *Bot) Handle(endpoint interface{}, h HandlerFunc, m ...MiddlewareFunc) {
if len(b.group.middleware) > 0 {
Expand Down
26 changes: 13 additions & 13 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ type Chat struct {
Still bool `json:"is_member,omitempty"`

// Returns only in getChat
Bio string `json:"bio,omitempty"`
Photo *ChatPhoto `json:"photo,omitempty"`
HasPrivateForwards bool `json:"has_private_forwards,omitempty"`
Description string `json:"description,omitempty"`
InviteLink string `json:"invite_link,omitempty"`
PinnedMessage *Message `json:"pinned_message,omitempty"`
Permissions *Rights `json:"permissions,omitempty"`
SlowMode int `json:"slow_mode_delay,omitempty"`
HasProtectedContent bool `json:"has_protected_content,omitempty"`
StickerSet string `json:"sticker_set_name,omitempty"`
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
LinkedChatID int64 `json:"linked_chat_id,omitempty"`
ChatLocation *ChatLocation `json:"location,omitempty"`
Bio string `json:"bio,omitempty"`
Photo *ChatPhoto `json:"photo,omitempty"`
Description string `json:"description,omitempty"`
InviteLink string `json:"invite_link,omitempty"`
PinnedMessage *Message `json:"pinned_message,omitempty"`
Permissions *Rights `json:"permissions,omitempty"`
SlowMode int `json:"slow_mode_delay,omitempty"`
StickerSet string `json:"sticker_set_name,omitempty"`
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
LinkedChatID int64 `json:"linked_chat_id,omitempty"`
ChatLocation *ChatLocation `json:"location,omitempty"`
Private bool `json:"has_private_forwards,omitempty"`
Protected bool `json:"has_protected_content,omitempty"`
}

type ChatLocation struct {
Expand Down
10 changes: 5 additions & 5 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ type Message struct {
// For forwarded messages, unixtime of the original message.
OriginalUnixtime int `json:"forward_date"`

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

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

// (Optional) Time of last edit in Unix
// (Optional) Time of last edit in Unix.
LastEdit int64 `json:"edit_date"`

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

// AlbumID is the unique identifier of a media message group
// this message belongs to.
Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type SendOptions struct {
// AllowWithoutReply allows sending messages not a as reply if the replied-to message has already been deleted.
AllowWithoutReply bool

// Protects the contents of the sent message from forwarding and saving
// Protected protects the contents of the sent message from forwarding and saving
Protected bool
}

Expand Down

0 comments on commit 8ad1e04

Please sign in to comment.