Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
970ec947
Commit
970ec947
authored
Jan 24, 2016
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline Entities created
parent
fa88ab2b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
361 additions
and
0 deletions
+361
-0
InlineQueryResult.php
src/Entities/InlineQueryResult.php
+63
-0
InlineQueryResultGif.php
src/Entities/InlineQueryResultGif.php
+74
-0
InlineQueryResultMpeg4Gif.php
src/Entities/InlineQueryResultMpeg4Gif.php
+73
-0
InlineQueryResultPhoto.php
src/Entities/InlineQueryResultPhoto.php
+79
-0
InlineQueryResultVideo.php
src/Entities/InlineQueryResultVideo.php
+72
-0
No files found.
src/Entities/InlineQueryResult.php
0 → 100644
View file @
970ec947
<?php
/*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Entities
;
use
Longman\TelegramBot\Exception\TelegramException
;
class
InlineQueryResult
extends
Entity
{
protected
$type
;
protected
$id
;
protected
$title
;
protected
$parse_mode
;
protected
$disable_web_page_preview
;
public
function
__construct
(
array
$data
)
{
$this
->
type
=
null
;
$this
->
id
=
isset
(
$data
[
'id'
])
?
$data
[
'id'
]
:
null
;
if
(
empty
(
$this
->
id
))
{
throw
new
TelegramException
(
'id is empty!'
);
}
$this
->
title
=
isset
(
$data
[
'title'
])
?
$data
[
'title'
]
:
null
;
if
(
empty
(
$this
->
title
))
{
throw
new
TelegramException
(
'title is empty!'
);
}
$this
->
disable_web_page_preview
=
isset
(
$data
[
'disable_webpage_preview'
])
?
$data
[
'disable_webpage_preview'
]
:
null
;
$this
->
parse_mode
=
isset
(
$data
[
'parse_mode'
])
?
$data
[
'parse_mode'
]
:
null
;
}
public
function
getType
()
{
return
$this
->
type
;
}
public
function
getId
()
{
return
$this
->
id
;
}
public
function
getTitle
()
{
return
$this
->
title
;
}
public
function
getParseMode
()
{
return
$this
->
parse_mode
;
}
public
function
getDisableWebPagePreview
()
{
return
$this
->
disable_web_page_preview
;
}
}
src/Entities/InlineQueryResultGif.php
0 → 100644
View file @
970ec947
<?php
/*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Entities
;
use
Longman\TelegramBot\Exception\TelegramException
;
class
InlineQueryResultGif
extends
InlineQueryResult
{
protected
$gif_url
;
protected
$gif_width
;
protected
$gif_height
;
protected
$thumb_url
;
protected
$caption
;
protected
$message_text
;
public
function
__construct
(
array
$data
)
{
parent
::
__construct
(
$data
);
$this
->
type
=
'gif'
;
$this
->
gif_url
=
isset
(
$data
[
'gif_url'
])
?
$data
[
'gif_url'
]
:
null
;
if
(
empty
(
$this
->
gif_url
))
{
throw
new
TelegramException
(
'gif_url is empty!'
);
}
$this
->
gif_width
=
isset
(
$data
[
'gif_width'
])
?
$data
[
'gif_width'
]
:
null
;
$this
->
gif_height
=
isset
(
$data
[
'gif_height'
])
?
$data
[
'gif_height'
]
:
null
;
$this
->
thumb_url
=
isset
(
$data
[
'thumb_url'
])
?
$data
[
'thumb_url'
]
:
null
;
if
(
empty
(
$this
->
thumb_url
))
{
throw
new
TelegramException
(
'thumb_url is empty!'
);
}
$this
->
caption
=
isset
(
$data
[
'caption'
])
?
$data
[
'caption'
]
:
null
;
$this
->
message_text
=
isset
(
$data
[
'message_text'
])
?
$data
[
'message_text'
]
:
null
;
}
public
function
getGifUrl
()
{
return
$this
->
gif_url
;
}
public
function
getGifWidth
()
{
return
$this
->
gif_width
;
}
public
function
getGifHeight
()
{
return
$this
->
gif_height
;
}
public
function
getThumbUrl
()
{
return
$this
->
thumb_url
;
}
public
function
getCaption
()
{
return
$this
->
caption
;
}
public
function
getMessageText
()
{
return
$this
->
message_text
;
}
}
src/Entities/InlineQueryResultMpeg4Gif.php
0 → 100644
View file @
970ec947
<?php
/*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Entities
;
use
Longman\TelegramBot\Exception\TelegramException
;
class
InlineQueryResultMpeg4Gif
extends
InlineQueryResult
{
protected
$mpeg4_url
;
protected
$mpeg4_width
;
protected
$mpeg4_height
;
protected
$thumb_url
;
protected
$caption
;
protected
$message_text
;
public
function
__construct
(
array
$data
)
{
parent
::
__construct
(
$data
);
$this
->
type
=
'mpeg4_gif'
;
$this
->
mpeg4_url
=
isset
(
$data
[
'mpeg4_url'
])
?
$data
[
'mpeg4_url'
]
:
null
;
if
(
empty
(
$this
->
mpeg4_url
))
{
throw
new
TelegramException
(
'mpeg4_url is empty!'
);
}
$this
->
mpeg4_width
=
isset
(
$data
[
'mpeg4_width'
])
?
$data
[
'mpeg4_width'
]
:
null
;
$this
->
mpeg4_height
=
isset
(
$data
[
'mpeg4_height'
])
?
$data
[
'mpeg4_height'
]
:
null
;
$this
->
thumb_url
=
isset
(
$data
[
'thumb_url'
])
?
$data
[
'thumb_url'
]
:
null
;
if
(
empty
(
$this
->
thumb_url
))
{
throw
new
TelegramException
(
'thumb_url is empty!'
);
}
$this
->
caption
=
isset
(
$data
[
'caption'
])
?
$data
[
'caption'
]
:
null
;
$this
->
message_text
=
isset
(
$data
[
'message_text'
])
?
$data
[
'message_text'
]
:
null
;
}
public
function
getMpeg4Url
()
{
return
$this
->
mpeg4_url
;
}
public
function
getMpeg4Width
()
{
return
$this
->
mpeg4_width
;
}
public
function
getMpeg4Height
()
{
return
$this
->
mpeg4_height
;
}
public
function
getThumbUrl
()
{
return
$this
->
thumb_url
;
}
public
function
getCaption
()
{
return
$this
->
caption
;
}
public
function
getMessageText
()
{
return
$this
->
message_text
;
}
}
src/Entities/InlineQueryResultPhoto.php
0 → 100644
View file @
970ec947
<?php
/*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Entities
;
use
Longman\TelegramBot\Exception\TelegramException
;
class
InlineQueryResultPhoto
extends
InlineQueryResult
{
protected
$photo_url
;
protected
$photo_width
;
protected
$photo_height
;
protected
$thumb_url
;
protected
$description
;
protected
$caption
;
protected
$message_text
;
public
function
__construct
(
array
$data
)
{
parent
::
__construct
(
$data
);
$this
->
type
=
'photo'
;
$this
->
photo_url
=
isset
(
$data
[
'photo_url'
])
?
$data
[
'photo_url'
]
:
null
;
if
(
empty
(
$this
->
photo_url
))
{
throw
new
TelegramException
(
'photo_url is empty!'
);
}
$this
->
photo_width
=
isset
(
$data
[
'photo_width'
])
?
$data
[
'photo_width'
]
:
null
;
$this
->
photo_height
=
isset
(
$data
[
'photo_height'
])
?
$data
[
'photo_height'
]
:
null
;
$this
->
thumb_url
=
isset
(
$data
[
'thumb_url'
])
?
$data
[
'thumb_url'
]
:
null
;
if
(
empty
(
$this
->
thumb_url
))
{
throw
new
TelegramException
(
'thumb_url is empty!'
);
}
$this
->
description
=
isset
(
$data
[
'description'
])
?
$data
[
'description'
]
:
null
;
$this
->
caption
=
isset
(
$data
[
'caption'
])
?
$data
[
'caption'
]
:
null
;
$this
->
message_text
=
isset
(
$data
[
'message_text'
])
?
$data
[
'message_text'
]
:
null
;
}
public
function
getPhotoUrl
()
{
return
$this
->
photo_url
;
}
public
function
getPhotoWidth
()
{
return
$this
->
photo_width
;
}
public
function
getPhotoHeight
()
{
return
$this
->
photo_height
;
}
public
function
getThumbUrl
()
{
return
$this
->
thumb_url
;
}
public
function
getDescription
()
{
return
$this
->
description
;
}
public
function
getCaption
()
{
return
$this
->
caption
;
}
public
function
getMessageText
()
{
return
$this
->
message_text
;
}
}
src/Entities/InlineQueryResultVideo.php
0 → 100644
View file @
970ec947
<?php
/*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Entities
;
use
Longman\TelegramBot\Exception\TelegramException
;
class
InlineQueryResultVideo
extends
InlineQueryResult
{
protected
$video_url
;
protected
$mime_type
;
protected
$message_text
;
protected
$video_width
;
protected
$video_height
;
protected
$video_duration
;
public
function
__construct
(
array
$data
)
{
parent
::
__construct
(
$data
);
$this
->
type
=
'video'
;
$this
->
video_url
=
isset
(
$data
[
'video_url'
])
?
$data
[
'video_url'
]
:
null
;
if
(
empty
(
$this
->
video_url
))
{
throw
new
TelegramException
(
'video_url is empty!'
);
}
$this
->
mime_type
=
isset
(
$data
[
'mime_type'
])
?
$data
[
'mime_type'
]
:
null
;
if
(
empty
(
$this
->
mime_type
))
{
throw
new
TelegramException
(
'mime_type is empty!'
);
}
$this
->
message_text
=
isset
(
$data
[
'message_text'
])
?
$data
[
'message_text'
]
:
null
;
if
(
empty
(
$this
->
message_text
))
{
throw
new
TelegramException
(
'message_text is empty!'
);
}
$this
->
video_width
=
isset
(
$data
[
'video_width'
])
?
$data
[
'video_width'
]
:
null
;
$this
->
video_height
=
isset
(
$data
[
'video_height'
])
?
$data
[
'video_height'
]
:
null
;
$this
->
video_duration
=
isset
(
$data
[
'video_duration'
])
?
$data
[
'video_duration'
]
:
null
;
}
public
function
getVideoUrl
()
{
return
$this
->
video_url
;
}
public
function
getMimeType
()
{
return
$this
->
mime_type
;
}
public
function
getMessageText
()
{
return
$this
->
message_text
;
}
public
function
getVideoWidth
()
{
return
$this
->
video_width
;
}
public
function
getVideoHeight
()
{
return
$this
->
video_height
;
}
public
function
getVideoDuration
()
{
return
$this
->
video_duration
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment