-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGame_T.m
40 lines (40 loc) · 1.41 KB
/
Game_T.m
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
function iqresult = Game_T(title, description, photo, varargin)
% Game_T - This object represents a game. Use BotFather to create and edit
% games, their short names will act as unique identifiers.
%
% title String Title of the game
%
% description String Description of the game
%
% photo Array of PhotoSize Photo that will be displayed in the game
% message in chats.
%
% text String Optional. Brief description of the game or high scores
% included in the game message. Can be automatically edited to include
% current high scores for the game when the bot calls setGameScore, or
% manually edited using editMessageText. 0-4096 characters.
%
% text_entities Array of MessageEntity Optional. Special entities that
% appear in text, such as usernames, URLs, bot commands, etc.
%
% animation Animation Optional. Animation that will be displayed in the
% game message in chats. Upload via BotFather
%
iqresult = struct;
iqresult.title = title;
iqresult.description = description;
iqresult.photo = photo;
while ~isempty(varargin)
switch lower(varargin{1})
case 'text'
iqresult.text = varargin{2};
case 'text_entities'
iqresult.text_entities = varargin{2};
case 'animation'
iqresult.animation = varargin{2};
otherwise
error(['Unexpected option: ' varargin{1}])
end % switch
varargin(1:2) = [];
end % while isempty
end