1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
pub mod TObject{

	type TInteger=isize;
	type TBoolean=bool;
	type TString=String;

	/// This object represents a Telegram user or bot.
	pub struct TUser{
		/// Unique identifier for this user or bot
		pub _id: TInteger,
		/// True, if this user is a bot
		pub _is_bot: TBoolean,
		/// User‘s or bot’s first name
		pub _first_name: TString,
		/// Optional. User‘s or bot’s last name
		pub _last_name: Option<TString>,
		/// Optional. User‘s or bot’s username
		pub _username: Option<TString>,
		/// Optional. IETF language tag of the user's language
		pub _language_code: Option<TString>
	}

	/// This object represents a chat.
	pub struct TChat{
		/// Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
		pub _id: TInteger,
		/// Type of chat, can be either “private”, “group”, “supergroup” or “channel”
		pub _type: TString,
		/// Optional. Title, for supergroups, channels and group chats
		pub _title: Option<TString>,
		/// Optional. Username, for private chats, supergroups and channels if available
		pub _username: Option<TString>,
		/// Optional. First name of the other party in a private chat
		pub _first_name: Option<TString>,
		/// Optional. Last name of the other party in a private chat
		pub _last_name: Option<TString>,
		/// Optional. True if a group has ‘All Members Are Admins’ enabled.
		pub _all_members_are_administrators: Option<TBoolean>,
		/// Optional. Chat photo. Returned only in getChat.
		pub _photo: Option<TChatPhoto>,
		/// Optional. Description, for supergroups and channel chats. Returned only in getChat.
		pub _description: Option<TString>,
		/// Optional. Chat invite link, for supergroups and channel chats. Returned only in getChat.
		pub _invite_link: Option<TString>,
		/// Optional. Pinned message, for supergroups. Returned only in getChat.
		pub _pinned_message: Option<Box<TMessage>>
	}

	/// This object represents a chat photo.
	pub struct TChatPhoto{
		/// Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
		pub _small_file_id:TString,
		/// Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
		pub _big_file_id:TString
	}

	/// This object represents a message.
	pub struct TMessage{
		/// Unique message identifier inside this chat
		pub _message_id: TInteger,
		/// Optional. Sender, empty for messages sent to channels
		pub _from: Option<TUser>,
		/// Date the message was sent in Unix time
		pub _date: TInteger,
		/// Conversation the message belongs to
		pub _chat: TChat,
		/// Optional. For forwarded messages, sender of the original message
		pub _forward_from: Option<TUser>,
		/// Optional. For messages forwarded from channels, information about the original channel
		pub _forward_from_chat: Option<TChat>,
		/// Optional. For messages forwarded from channels, identifier of the original message in the channel
		pub _forward_from_message_id: Option<TInteger>,
		/// Optional. For messages forwarded from channels, signature of the post author if present
		pub _forward_signature: Option<TString>,
		/// Optional. For forwarded messages, date the original message was sent in Unix time
		pub _forward_date: Option<TInteger>,
		/// Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
		pub _reply_to_message: Option<Box<TMessage>>,
		/// Optional. Date the message was last edited in Unix time
		pub _edit_date: Option<TInteger>,
		/// Optional. Signature of the post author for messages in channels
		pub _author_signature: Option<TString>,
		/// Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters.
		pub _text: Option<TString>,
		/// Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
		pub _entities: Option<Vec<TMessageEntity>>
	}

	/// This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
	pub struct TMessageEntity{
		/// Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
		pub _type: TString,
		/// Offset in UTF-16 code units to the start of the entity
		pub _offset: TInteger,
		/// Length of the entity in UTF-16 code units
		pub _length: TInteger,
		/// Optional. For “text_link” only, url that will be opened after user taps on the text
		pub _url: Option<TString>,
		/// Optional. For “text_mention” only, the mentioned user
		pub _user: Option<TUser>
	}
}