mirror of https://github.com/tucnak/telebot
A little more documentation, code cleanup
parent
dbcd156645
commit
fa51650dad
@ -1,11 +0,0 @@
|
||||
package telebot
|
||||
|
||||
type Message struct {
|
||||
Id int `json:"message_id"`
|
||||
Sender User `json:"from"`
|
||||
Unixtime int `json:"date"`
|
||||
Text string `json:"text"`
|
||||
|
||||
// Equal to Sender for PM
|
||||
Chat User `json:"chat"`
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package telebot
|
||||
|
||||
// User object represents a Telegram user, bot or group chat.
|
||||
type User struct {
|
||||
Id int `json:"id"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Username string `json:"username"`
|
||||
|
||||
// Title differs a group chat apart from users and bots.
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// Message object represents a message.
|
||||
type Message struct {
|
||||
Id int `json:"message_id"`
|
||||
Sender User `json:"from"`
|
||||
Unixtime int `json:"date"`
|
||||
Text string `json:"text"`
|
||||
Chat User `json:"chat"`
|
||||
}
|
||||
|
||||
// Update object represents an incoming update.
|
||||
type Update struct {
|
||||
Id int `json:"update_id"`
|
||||
Payload Message `json:"message"`
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package telebot
|
||||
|
||||
type Update struct {
|
||||
Id int `json:"update_id"`
|
||||
Payload Message `json:"message"`
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package telebot
|
||||
|
||||
type User struct {
|
||||
Id int
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Username string
|
||||
|
||||
// In case of group chat, Title will indicate
|
||||
// whether it's a chat or user: if Title is empty
|
||||
// it's a user, otherwise it's not.
|
||||
Title string
|
||||
}
|
Loading…
Reference in New Issue