telebot: prettify docs

pull/341/head
Demian 4 years ago
parent fd55a4b8a7
commit 2f11c43bd9

@ -30,8 +30,8 @@ func NoRights() Rights { return Rights{} }
// NoRestrictions should be used when un-restricting or
// un-promoting user.
//
// member.Rights = tb.NoRestrictions()
// bot.Restrict(chat, member)
// member.Rights = tb.NoRestrictions()
// b.Restrict(chat, member)
//
func NoRestrictions() Rights {
return Rights{

@ -978,7 +978,7 @@ func (b *Bot) Notify(to Recipient, action ChatAction) error {
// Ship replies to the shipping query, if you sent an invoice
// requesting an address and the parameter is_flexible was specified.
//
// Usage:
// Example:
//
// b.Ship(query) // OK
// b.Ship(query, opts...) // OK with options
@ -1050,8 +1050,8 @@ func (b *Bot) Answer(query *Query, resp *QueryResponse) error {
//
// Example:
//
// bot.Respond(c)
// bot.Respond(c, response)
// b.Respond(c)
// b.Respond(c, response)
//
func (b *Bot) Respond(c *Callback, resp ...*CallbackResponse) error {
var r *CallbackResponse

@ -31,7 +31,7 @@ type File struct {
// so upon uploading media you'll need to set embedded File
// with something. NewFile() returning File makes it a one-liner.
//
// photo := &tb.Photo{File: tb.FromDisk("chicken.jpg")}
// photo := &tb.Photo{File: tb.FromDisk("chicken.jpg")}
//
func FromDisk(filename string) File {
return File{FileLocal: filename}
@ -44,7 +44,7 @@ func FromDisk(filename string) File {
// so upon uploading media you'll need to set embedded File
// with something. NewFile() returning File makes it a one-liner.
//
// photo := &tb.Photo{File: tb.FromURL("https://site.com/picture.jpg")}
// photo := &tb.Photo{File: tb.FromURL("https://site.com/picture.jpg")}
//
func FromURL(url string) File {
return File{FileURL: url}
@ -57,7 +57,7 @@ func FromURL(url string) File {
// so upon uploading media you'll need to set embedded File
// with something. NewFile() returning File makes it a one-liner.
//
// photo := &tb.Photo{File: tb.FromReader(bytes.NewReader(...))}
// photo := &tb.Photo{File: tb.FromReader(bytes.NewReader(...))}
//
func FromReader(reader io.Reader) File {
return File{FileReader: reader}

Loading…
Cancel
Save