Update version 3.6

This commit is contained in:
Ruben Bermudez 2018-02-14 20:36:22 +01:00
parent 014f17818b
commit 6db6c4bf0d
36 changed files with 938 additions and 105 deletions

548
Bots.ipr
View File

@ -36,6 +36,466 @@
<module name="telegrambots-meta" target="1.8" />
</bytecodeTargetLevel>
</component>
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DataExportManager">
<export-instructions>
<create-header value="true" />
<quote-values-containing-separator value="true" />
<quote-all-values value="false" />
<value-separator value="" />
<file-name value="" />
<file-location value="" />
<scope value="GLOBAL" />
<destination value="FILE" />
<format value="EXCEL" />
<charset value="UTF-8" />
</export-instructions>
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="true" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.EditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.MethodExecutionManager">
<method-browser />
<execution-history>
<group-entries value="true" />
<execution-inputs />
</execution-history>
<argument-values-cache />
</component>
<component name="DBNavigator.Project.ObjectDependencyManager">
<last-used-dependency-type value="INCOMING" />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true">
<recently-used-interfaces />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="NESTED TABLE" enabled="false" />
<object-type name="COLUMN" enabled="false" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE ATTRIBUTE" enabled="false" />
<object-type name="ARGUMENT" enabled="false" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<tracking-columns>
<columnNames value="" />
<visible value="true" />
<editable value="false" />
</tracking-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-list-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-list-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="CSS" enabled="true" />
<content-type name="Java" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="JPA QL" enabled="true" />
<content-type name="JavaScript" enabled="true" />
<content-type name="JSP" enabled="true" />
<content-type name="JSPx" enabled="true" />
<content-type name="Groovy" enabled="true" />
<content-type name="FTL" enabled="true" />
<content-type name="TML" enabled="true" />
<content-type name="GSP" enabled="true" />
<content-type name="ASP" enabled="true" />
<content-type name="VTL" enabled="true" />
<content-type name="AIDL" enabled="true" />
<content-type name="YAML" enabled="true" />
<content-type name="Flex" enabled="true" />
<content-type name="Manifest" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
<target-connection value="ASK" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
<debugger>
<debugger-type value="ASK" />
<use-generic-runners value="true" />
</debugger>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
</component>
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/telegrambots" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/telegrambots-abilities" charset="UTF-8" />
@ -46,9 +506,39 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JSLint" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="note" />
</inspection_tool>
</profile>
<version value="1.0" />
</component>
@ -129,9 +619,6 @@
<exe-path>/usr/local/bin/bower</exe-path>
<config-path />
</component>
<component name="KotlinCommonCompilerArguments">
<option name="coroutinesWarn" value="false" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
@ -262,7 +749,32 @@
</component>
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value />
<value>
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</value>
</option>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="GoogleStyle" />
</component>
@ -960,6 +1472,32 @@
<root url="jar://$MAVEN_REPOSITORY$/org/mockito/mockito-all/2.0.2-beta/mockito-all-2.0.2-beta-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.telegram:telegrambots-meta:3.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/telegram/telegrambots-meta/3.5/telegrambots-meta-3.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/telegrambots-meta/telegrambots-meta-3.5-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/telegram/telegrambots-meta/3.5/telegrambots-meta-3.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/telegrambots-meta/telegrambots-meta-3.5-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/telegram/telegrambots-meta/3.5/telegrambots-meta-3.5-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.telegram:telegrambots:3.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/telegram/telegrambots/3.5/telegrambots-3.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/telegrambots/telegrambots-3.5-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/telegram/telegrambots/3.5/telegrambots-3.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/telegrambots/telegrambots-3.5-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/telegram/telegrambots/3.5/telegrambots-3.5-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="masterDetails">
<states>

View File

@ -27,16 +27,16 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>3.5</version>
<version>3.6</version>
</dependency>
```
```gradle
compile "org.telegram:telegrambots:3.5"
compile "org.telegram:telegrambots:3.6"
```
2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.5)
3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.5)
2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.6)
3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.6)
In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`.

View File

@ -1,3 +1,7 @@
### <a id="3.6"></a>3.6 ###
1. Support for Api Version [3.6](https://core.telegram.org/bots/api-changelog#february-13-2018)
2. Bug fixing and other improvements
### <a id="3.5"></a>3.5 ###
1. Support for Api Version [3.5](https://core.telegram.org/bots/api-changelog#november-17-2017)
2. Bug fixing: #168, #329 and #335

View File

@ -11,7 +11,7 @@ First you need ot get the library and add it to your project. There are few poss
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>3.5</version>
<version>3.6</version>
</dependency>
```
* With **Gradle**:

View File

@ -9,12 +9,12 @@ As with any Java project, you will need to set your dependencies.
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilties</artifactId>
<version>3.5</version>
<version>3.6</version>
</dependency>
```
* **Gradle**
```groovy
compile group: 'org.telegram', name: 'telegrambots-abilties', version: '3.5'
compile group: 'org.telegram', name: 'telegrambots-abilties', version: '3.6'
```
* [JitPack](https://jitpack.io/#rubenlagus/TelegramBots)

View File

@ -7,7 +7,7 @@
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<packaging>pom</packaging>
<version>3.5</version>
<version>3.6</version>
<modules>
<module>telegrambots</module>
@ -26,6 +26,6 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<bots.version>3.5</bots.version>
<bots.version>3.6</bots.version>
</properties>
</project>

View File

@ -18,19 +18,19 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>3.5</version>
<version>3.6</version>
</dependency>
```
**Gradle**
```gradle
compile "org.telegram:telegrambots-abilities:3.5"
compile "org.telegram:telegrambots-abilities:3.6"
```
**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v3.5)
**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v3.6)
**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.5)
**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.6)
Motivation
----------

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>3.5</version>
<version>3.6</version>
<packaging>jar</packaging>
<name>Telegram Ability Bot</name>
@ -65,7 +65,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<bots.version>3.5</bots.version>
<bots.version>3.6</bots.version>
<commonslang.version>3.5</commonslang.version>
<mapdb.version>3.0.4</mapdb.version>
<guava.version>19.0</guava.version>

View File

@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambotsextensions</artifactId>
<version>3.5</version>
<version>3.6</version>
</dependency>
```
2. Using Gradle:
```gradle
compile "org.telegram:telegrambotsextensions:3.5"
compile "org.telegram:telegrambotsextensions:3.6"
```

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambotsextensions</artifactId>
<version>3.5</version>
<version>3.6</version>
<packaging>jar</packaging>
<name>Telegram Bots Extensions</name>
@ -59,7 +59,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<bots.version>3.5</bots.version>
<bots.version>3.6</bots.version>
</properties>
<dependencies>

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-meta</artifactId>
<version>3.5</version>
<version>3.6</version>
<packaging>jar</packaging>
<name>Telegram Bots Meta</name>

View File

@ -17,12 +17,11 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Use this method to send audio files, Use this method to send audio files, if you want
* Use this method to send audio files, Use this method to send audio files, if you want
* Telegram clients to display them in the music player. Your audio must be in an .mp3 format. On
* success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in
* size, this limit may be changed in the future.
* @note For sending voice notes, use sendVoice method instead.
* @date 16 of July of 2015
*/
public class SendAudio extends PartialBotApiMethod<Message> {
public static final String PATH = "sendaudio";
@ -36,6 +35,8 @@ public class SendAudio extends PartialBotApiMethod<Message> {
public static final String PERFOMER_FIELD = "performer";
public static final String TITLE_FIELD = "title";
public static final String CAPTION_FIELD = "caption";
public static final String PARSEMODE_FIELD = "parse_mode";
private Integer duration; ///< Integer Duration of the audio in seconds as defined by sender
private String chatId; ///< Unique identifier for the chat to send the message to (or Username fro channels)
@ -46,6 +47,7 @@ public class SendAudio extends PartialBotApiMethod<Message> {
private String performer; ///< Optional. Performer of sent audio
private String title; ///< Optional. Title of sent audio
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewAudio; ///< True to upload a new audio, false to use a fileId
private String audioName;
@ -191,6 +193,15 @@ public class SendAudio extends PartialBotApiMethod<Message> {
return this;
}
public String getParseMode() {
return parseMode;
}
public SendAudio setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@ -239,11 +250,12 @@ public class SendAudio extends PartialBotApiMethod<Message> {
", replyMarkup=" + replyMarkup +
", performer='" + performer + '\'' +
", title='" + title + '\'' +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
", isNewAudio=" + isNewAudio +
", audioName='" + audioName + '\'' +
", newAudioFile=" + newAudioFile +
", newAudioStream=" + newAudioStream +
", caption='" + caption + '\'' +
'}';
}
}

View File

@ -17,8 +17,7 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Use this method to send general files. On success, the sent Message is returned.
* @date 20 of June of 2015
* Use this method to send general files. On success, the sent Message is returned.
*/
public class SendDocument extends PartialBotApiMethod<Message> {
public static final String PATH = "senddocument";
@ -29,12 +28,15 @@ public class SendDocument extends PartialBotApiMethod<Message> {
public static final String DISABLENOTIFICATION_FIELD = "disable_notification";
public static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
public static final String REPLYMARKUP_FIELD = "reply_markup";
public static final String PARSEMODE_FIELD = "parse_mode";
private String chatId; ///< Unique identifier for the chat to send the message to or Username for the channel to send the message to
private String document; ///< File file to send. file_id as String to resend a file that is already on the Telegram servers or Url to upload it
private String caption; ///< Optional. Document caption (may also be used when resending documents by file_id), 0-200 characters
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewDocument; ///< True to upload a new document, false to use a fileId
private String documentName;
@ -154,6 +156,15 @@ public class SendDocument extends PartialBotApiMethod<Message> {
return this;
}
public String getParseMode() {
return parseMode;
}
public SendDocument setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@ -196,9 +207,15 @@ public class SendDocument extends PartialBotApiMethod<Message> {
return "SendDocument{" +
"chatId='" + chatId + '\'' +
", document='" + document + '\'' +
", caption='" + caption + '\'' +
", disableNotification=" + disableNotification +
", replyToMessageId=" + replyToMessageId +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
", isNewDocument=" + isNewDocument +
", documentName='" + documentName + '\'' +
", newDocumentFile=" + newDocumentFile +
", newDocumentStream=" + newDocumentStream +
'}';
}
}

View File

@ -17,8 +17,7 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Use this method to send photos. On success, the sent Message is returned.
* @date 20 of June of 2015
* Use this method to send photos. On success, the sent Message is returned.
*/
public class SendPhoto extends PartialBotApiMethod<Message> {
public static final String PATH = "sendphoto";
@ -29,12 +28,15 @@ public class SendPhoto extends PartialBotApiMethod<Message> {
public static final String DISABLENOTIFICATION_FIELD = "disable_notification";
public static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
public static final String REPLYMARKUP_FIELD = "reply_markup";
public static final String PARSEMODE_FIELD = "parse_mode";
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
private String photo; ///< Photo to send. file_id as String to resend a photo that is already on the Telegram servers or URL to upload it
private String caption; ///< Optional Photo caption (may also be used when resending photos by file_id).
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewPhoto; ///< True if the photo must be uploaded from a file, file if it is a fileId
private String photoName; ///< Name of the photo
@ -142,6 +144,15 @@ public class SendPhoto extends PartialBotApiMethod<Message> {
return this;
}
public String getParseMode() {
return parseMode;
}
public SendPhoto setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@ -184,9 +195,14 @@ public class SendPhoto extends PartialBotApiMethod<Message> {
"chatId='" + chatId + '\'' +
", photo='" + photo + '\'' +
", caption='" + caption + '\'' +
", disableNotification=" + disableNotification +
", replyToMessageId=" + replyToMessageId +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
", isNewPhoto=" + isNewPhoto +
", photoName='" + photoName + '\'' +
", newPhotoFile=" + newPhotoFile +
", newPhotoStream=" + newPhotoStream +
'}';
}
}

View File

@ -31,17 +31,22 @@ public class SendVideo extends PartialBotApiMethod<Message> {
public static final String WIDTH_FIELD = "width";
public static final String HEIGHT_FIELD = "height";
public static final String DISABLENOTIFICATION_FIELD = "disable_notification";
public static final String SUPPORTSSTREAMING_FIELD = "supports_streaming";
public static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
public static final String REPLYMARKUP_FIELD = "reply_markup";
public static final String PARSEMODE_FIELD = "parse_mode";
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
private String video; ///< Video to send. file_id as String to resend a video that is already on the Telegram servers or URL to upload it
private Integer duration; ///< Optional. Duration of sent video in seconds
private String caption; ///< OptionaL. Video caption (may also be used when resending videos by file_id).
private Integer width; ///< Optional. Video width
private Integer height; ///< OptionaL. Video height
private Boolean supportsStreaming; ///< Optional. Pass True, if the uploaded video is suitable for streaming
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewVideo; ///< True to upload a new video, false to use a fileId
private String videoName; ///< Name of the video
@ -176,6 +181,24 @@ public class SendVideo extends PartialBotApiMethod<Message> {
return this;
}
public Boolean getSupportsStreaming() {
return supportsStreaming;
}
public SendVideo setSupportsStreaming(Boolean supportsStreaming) {
this.supportsStreaming = supportsStreaming;
return this;
}
public String getParseMode() {
return parseMode;
}
public SendVideo setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {

View File

@ -17,10 +17,9 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Use this method to send voice notes, if you want Telegram clients to display the file as a
* Use this method to send voice notes, if you want Telegram clients to display the file as a
* playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS
* (other formats may be sent as Audio or Document).
* @date 16 of July of 2015
*/
public class SendVoice extends PartialBotApiMethod<Message> {
public static final String PATH = "sendvoice";
@ -32,6 +31,7 @@ public class SendVoice extends PartialBotApiMethod<Message> {
public static final String REPLYMARKUP_FIELD = "reply_markup";
public static final String DURATION_FIELD = "duration";
public static final String CAPTION_FIELD = "caption";
public static final String PARSEMODE_FIELD = "parse_mode";
private String chatId; ///< Unique identifier for the chat sent message to (Or username for channels)
private String voice; ///< Audio file to send. You can either pass a file_id as String to resend an audio that is already on the Telegram servers, or upload a new audio file using multipart/form-data.
@ -40,6 +40,7 @@ public class SendVoice extends PartialBotApiMethod<Message> {
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
private Integer duration; ///< Optional. Duration of sent audio in seconds
private String caption; ///< Optional. Voice caption (may also be used when resending videos by file_id).
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewVoice; ///< True to upload a new voice note, false to use a fileId
private String voiceName; ///< Name of the voice note
@ -156,6 +157,15 @@ public class SendVoice extends PartialBotApiMethod<Message> {
return this;
}
public String getParseMode() {
return parseMode;
}
public SendVoice setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@ -203,6 +213,7 @@ public class SendVoice extends PartialBotApiMethod<Message> {
", replyMarkup=" + replyMarkup +
", duration=" + duration +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
", isNewVoice=" + isNewVoice +
", voiceName='" + voiceName + '\'' +
", newVoiceFile=" + newVoiceFile +

View File

@ -16,9 +16,8 @@ import java.io.Serializable;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Use this method to edit captions of messages sent by the bot or via the bot (for inline
* Use this method to edit captions of messages sent by the bot or via the bot (for inline
* bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
* @date 10 of April of 2016
*/
public class EditMessageCaption extends BotApiMethod<Serializable> {
public static final String PATH = "editmessagecaption";
@ -28,6 +27,7 @@ public class EditMessageCaption extends BotApiMethod<Serializable> {
private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id";
private static final String CAPTION_FIELD = "caption";
private static final String REPLYMARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
/**
* Required if inline_message_id is not specified. Unique identifier for the chat to send the
@ -49,6 +49,8 @@ public class EditMessageCaption extends BotApiMethod<Serializable> {
private String caption; ///< Optional. New caption of the message
@JsonProperty(REPLYMARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard.
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public EditMessageCaption() {
super();
@ -99,6 +101,15 @@ public class EditMessageCaption extends BotApiMethod<Serializable> {
return this;
}
public String getParseMode() {
return parseMode;
}
public EditMessageCaption setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public String getMethod() {
return PATH;
@ -155,11 +166,12 @@ public class EditMessageCaption extends BotApiMethod<Serializable> {
@Override
public String toString() {
return "EditMessageCaption{" +
"chatId=" + chatId +
"chatId='" + chatId + '\'' +
", messageId=" + messageId +
", inlineMessageId=" + inlineMessageId +
", caption=" + caption +
", inlineMessageId='" + inlineMessageId + '\'' +
", caption='" + caption + '\'' +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -56,6 +56,7 @@ public class Message implements BotApiObject {
private static final String AUTHORSIGNATURE_FIELD = "author_signature";
private static final String FORWARDSIGNATURE_FIELD = "forward_signature";
private static final String MEDIAGROUPID_FIELD = "media_group_id";
private static final String CONNECTEDWEBSITE_FIELD = "connected_website";
@JsonProperty(MESSAGEID_FIELD)
private Integer messageId; ///< Integer Unique message identifier
@ -174,7 +175,9 @@ public class Message implements BotApiObject {
@JsonProperty(FORWARDSIGNATURE_FIELD)
private String forwardSignature; ///< Optional. Post author signature for messages forwarded from channel chats
@JsonProperty(MEDIAGROUPID_FIELD)
private String mediaGroupId;
private String mediaGroupId; ///< Optional. The unique identifier of a media message group this message belongs to
@JsonProperty(CONNECTEDWEBSITE_FIELD)
private String connectedWebsite; ///< Optional. The domain name of the website on which the user has logged in
public Message() {
super();
@ -418,6 +421,10 @@ public class Message implements BotApiObject {
return mediaGroupId;
}
public String getConnectedWebsite() {
return connectedWebsite;
}
@Override
public String toString() {
return "Message{" +
@ -462,6 +469,7 @@ public class Message implements BotApiObject {
", authorSignature='" + authorSignature + '\'' +
", forwardSignature='" + forwardSignature + '\'' +
", mediaGroupId='" + mediaGroupId + '\'' +
", connectedWebsite='" + connectedWebsite + '\'' +
'}';
}
}

View File

@ -9,12 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to an mp3 audio file. By default, this audio file will be sent by the
* Represents a link to an mp3 audio file. By default, this audio file will be sent by the
* user. Alternatively, you can use input_message_content to send a message with the specified
* content instead of the audio.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
*/
public class InlineQueryResultAudio implements InlineQueryResult {
@ -27,6 +26,7 @@ public class InlineQueryResultAudio implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "audio"; ///< Type of the result, must be "audio"
@ -46,6 +46,8 @@ public class InlineQueryResultAudio implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultAudio() {
super();
@ -127,6 +129,15 @@ public class InlineQueryResultAudio implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultAudio setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -146,7 +157,8 @@ public class InlineQueryResultAudio implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultAudio{" +
"id='" + id + '\'' +
"type='" + type + '\'' +
", id='" + id + '\'' +
", audioUrl='" + audioUrl + '\'' +
", title='" + title + '\'' +
", performer='" + performer + '\'' +
@ -154,6 +166,7 @@ public class InlineQueryResultAudio implements InlineQueryResult {
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -9,13 +9,12 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a file. By default, this file will be sent by the user with an
* Represents a link to a file. By default, this file will be sent by the user with an
* optional caption. Alternatively, you can use input_message_content to send a message with the
* specified content instead of the file.
* @note Currently, only .PDF and .ZIP files can be sent using this method.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 01 of January of 2016
*/
public class InlineQueryResultDocument implements InlineQueryResult {
@ -31,6 +30,7 @@ public class InlineQueryResultDocument implements InlineQueryResult {
private static final String THUMBURL_FIELD = "thumb_url";
private static final String THUMBWIDTH_FIELD = "thumb_width";
private static final String THUMBHEIGHT_FIELD = "thumb_height";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "document"; ///< Type of the result, must be "document"
@ -56,6 +56,8 @@ public class InlineQueryResultDocument implements InlineQueryResult {
private Integer thumbWidth; ///< Optional. Thumbnail width
@JsonProperty(THUMBHEIGHT_FIELD)
private Integer thumbHeight; ///< Optional. Thumbnail height
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultDocument() {
super();
@ -164,6 +166,15 @@ public class InlineQueryResultDocument implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultDocument setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -191,16 +202,17 @@ public class InlineQueryResultDocument implements InlineQueryResult {
return "InlineQueryResultDocument{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", mimeType='" + mimeType + '\'' +
", documentUrl='" + documentUrl + '\'' +
", thumbHeight=" + thumbHeight +
", thumbWidth=" + thumbWidth +
", thumbUrl='" + thumbUrl + '\'' +
", title='" + title + '\'' +
", documentUrl='" + documentUrl + '\'' +
", mimeType='" + mimeType + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", replyMarkup=" + replyMarkup +
", inputMessageContent=" + inputMessageContent +
", thumbUrl='" + thumbUrl + '\'' +
", thumbWidth=" + thumbWidth +
", thumbHeight=" + thumbHeight +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -9,13 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to an animated GIF file. By default, this animated GIF file will be sent
* Represents a link to an animated GIF file. By default, this animated GIF file will be sent
* by the user with optional caption. Alternatively, you can use input_message_content to send a
* message with the specified content instead of the animation.
* @date 01 of January of 2016
*/
public class InlineQueryResultGif implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String GIFURL_FIELD = "gif_url";
@ -27,6 +25,7 @@ public class InlineQueryResultGif implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String GIF_DURATION_FIELD = "gif_duration";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "gif"; ///< Type of the result, must be "gif"
@ -50,6 +49,8 @@ public class InlineQueryResultGif implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(GIF_DURATION_FIELD)
private Integer gifDuration; ///< Optional. Duration of the GIF
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultGif() {
super();
@ -144,8 +145,18 @@ public class InlineQueryResultGif implements InlineQueryResult {
return gifDuration;
}
public void setGifDuration(Integer gifDuration) {
public InlineQueryResultGif setGifDuration(Integer gifDuration) {
this.gifDuration = gifDuration;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultGif setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
@ -178,6 +189,7 @@ public class InlineQueryResultGif implements InlineQueryResult {
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", gifDuration=" + gifDuration +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -27,6 +27,7 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String MPEG4_DURATION_FIELD = "mpeg4_duration";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "mpeg4_gif"; ///< Type of the result, must be "mpeg4_gif"
@ -50,6 +51,8 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(MPEG4_DURATION_FIELD)
private Integer mpeg4Duration; ///< Optional. Video duration
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultMpeg4Gif() {
super();
@ -144,8 +147,18 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
return mpeg4Duration;
}
public void setMpeg4Duration(Integer mpeg4Duration) {
public InlineQueryResultMpeg4Gif setMpeg4Duration(Integer mpeg4Duration) {
this.mpeg4Duration = mpeg4Duration;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultMpeg4Gif setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
@ -178,6 +191,7 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", mpeg4Duration=" + mpeg4Duration +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -9,13 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a photo. By default, this photo will be sent by the user with
* Represents a link to a photo. By default, this photo will be sent by the user with
* optional caption. Alternatively, you can use input_message_content to send a message with the
* specified content instead of the photo.
* @date 01 of January of 2016
*/
public class InlineQueryResultPhoto implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String PHOTOURL_FIELD = "photo_url";
@ -28,6 +26,7 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "photo"; ///< Type of the result, must be photo
@ -53,6 +52,8 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultPhoto() {
super();
@ -161,6 +162,15 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultPhoto setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -190,8 +200,9 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -9,13 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents link to a page containing an embedded video player or a video file.
* Represents link to a page containing an embedded video player or a video file.
* Alternatively, you can use input_message_content to send a message with the specified content
* instead of the video.
* @date 01 of January of 2016
*/
public class InlineQueryResultVideo implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String MIMETYPE_FIELD = "mime_type";
@ -29,6 +27,7 @@ public class InlineQueryResultVideo implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "video"; ///< Type of the result, must be "video"
@ -56,6 +55,8 @@ public class InlineQueryResultVideo implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultVideo() {
super();
@ -173,6 +174,15 @@ public class InlineQueryResultVideo implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultVideo setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -203,8 +213,9 @@ public class InlineQueryResultVideo implements InlineQueryResult {
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -9,15 +9,13 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a voice recording in an .ogg container encoded with OPUS. By default,
* Represents a link to a voice recording in an .ogg container encoded with OPUS. By default,
* this voice recording will be sent by the user. Alternatively, you can use input_message_content
* to send a message with the specified content instead of the the voice message.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
*/
public class InlineQueryResultVoice implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VOICEURL_FIELD = "voice_url";
@ -26,6 +24,7 @@ public class InlineQueryResultVoice implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "voice"; ///< Type of the result, must be "voice"
@ -43,6 +42,8 @@ public class InlineQueryResultVoice implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Voice caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultVoice() {
super();
@ -134,13 +135,15 @@ public class InlineQueryResultVoice implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultVoice{" +
"id='" + id + '\'' +
"type='" + type + '\'' +
", id='" + id + '\'' +
", voiceUrl='" + voiceUrl + '\'' +
", title='" + title + '\'' +
", voiceDuration=" + voiceDuration +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -25,6 +25,7 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "audio"; ///< Type of the result, must be "audio"
@ -38,6 +39,8 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedAudio() {
super();
@ -92,6 +95,15 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedAudio setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -111,11 +123,13 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultCachedAudio{" +
"id='" + id + '\'' +
"type='" + type + '\'' +
", id='" + id + '\'' +
", audioFileId='" + audioFileId + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -10,13 +10,12 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a file stored on the Telegram servers. By default, this file will be
* Represents a link to a file stored on the Telegram servers. By default, this file will be
* sent by the user with an optional caption. Alternatively, you can use input_message_content to
* send a message with the specified content instead of the file.
* @note Currently, only pdf-files and zip archives can be sent using this method.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
*/
public class InlineQueryResultCachedDocument implements InlineQueryResult {
@ -28,6 +27,7 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "document"; ///< Type of the result, must be "document"
@ -45,6 +45,8 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the file
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedDocument() {
super();
@ -117,6 +119,15 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedDocument setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -141,12 +152,13 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
return "InlineQueryResultCachedDocument{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", documentFileId='" + documentFileId + '\'' +
", caption='" + caption + '\'' +
", title='" + title + '\'' +
", documentFileId='" + documentFileId + '\'' +
", description='" + description + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", caption='" + caption + '\'' +
", replyMarkup=" + replyMarkup +
", inputMessageContent=" + inputMessageContent +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -10,13 +10,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to an animated GIF file stored on the Telegram servers. By default, this
* Represents a link to an animated GIF file stored on the Telegram servers. By default, this
* animated GIF file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with specified content instead of the animation.
* @date 10 of April of 2016
*/
public class InlineQueryResultCachedGif implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String GIF_FILE_ID_FIELD = "gif_file_id";
@ -24,6 +22,7 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "gif"; ///< Type of the result, must be "gif"
@ -39,6 +38,8 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the GIF animation
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedGif() {
super();
@ -102,6 +103,15 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedGif setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -123,11 +133,12 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
return "InlineQueryResultCachedGif{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", gifUrl='" + gifFileId + '\'' +
", gifFileId='" + gifFileId + '\'' +
", title='" + title + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -24,6 +24,7 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "mpeg4_gif"; ///< Type of the result, must be "mpeg4_gif"
@ -39,6 +40,8 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedMpeg4Gif() {
super();
@ -102,6 +105,15 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedMpeg4Gif setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -123,11 +135,12 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
return "InlineQueryResultCachedMpeg4Gif{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", mpeg4Url='" + mpeg4FileId + '\'' +
", mpeg4FileId='" + mpeg4FileId + '\'' +
", title='" + title + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -10,13 +10,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a photo stored on the Telegram servers. By default, this photo will
* Represents a link to a photo stored on the Telegram servers. By default, this photo will
* be sent by the user with an optional caption. Alternatively, you can use input_message_content to
* send a message with the specified content instead of the photo.
* @date 10 of April of 2016
*/
public class InlineQueryResultCachedPhoto implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String PHOTOFILEID_FIELD = "photo_file_id";
@ -25,6 +23,7 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "photo"; ///< Type of the result, must be photo
@ -42,6 +41,8 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedPhoto() {
super();
@ -114,6 +115,15 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedPhoto setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -139,8 +149,9 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -10,13 +10,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a video file stored on the Telegram servers. By default, this video
* Represents a link to a video file stored on the Telegram servers. By default, this video
* file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with the specified content instead of the video.
* @date 10 of April of 2016
*/
public class InlineQueryResultCachedVideo implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VIDEO_FILE_ID_FIELD = "video_file_id";
@ -25,6 +23,7 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "video"; ///< Type of the result, must be "video"
@ -42,6 +41,8 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedVideo() {
super();
@ -114,6 +115,15 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedVideo setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -135,12 +145,13 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
return "InlineQueryResultCachedVideo{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", caption='" + caption + '\'' +
", videoFileId='" + videoFileId + '\'' +
", title='" + title + '\'' +
", description='" + description + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -10,15 +10,13 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a voice message stored on the Telegram servers. By default, this
* Represents a link to a voice message stored on the Telegram servers. By default, this
* voice message will be sent by the user. Alternatively, you can use input_message_content to send
* a message with the specified content instead of the voice message.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
*/
public class InlineQueryResultCachedVoice implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VOICE_FILE_ID_FIELD = "voice_file_id";
@ -26,6 +24,7 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "voice"; ///< Type of the result, must be "voice"
@ -41,6 +40,8 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Voice caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedVoice() {
super();
@ -104,6 +105,15 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedVoice setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@ -123,12 +133,14 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultCachedVoice{" +
"id='" + id + '\'' +
"type='" + type + '\'' +
", id='" + id + '\'' +
", voiceFileId='" + voiceFileId + '\'' +
", title='" + title + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -17,6 +17,7 @@ public abstract class InputMedia<T> implements InputBotApiObject, Validable {
protected static final String TYPE_FIELD = "type";
private static final String MEDIA_FIELD = "media";
private static final String CAPTION_FIELD = "caption";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(MEDIA_FIELD)
/**
@ -27,7 +28,8 @@ public abstract class InputMedia<T> implements InputBotApiObject, Validable {
private String media;
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Caption of the media to be sent, 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
@JsonIgnore
private boolean isNewMedia; ///< True to upload a new media, false to use a fileId or URL
@JsonIgnore
@ -113,6 +115,15 @@ public abstract class InputMedia<T> implements InputBotApiObject, Validable {
return this;
}
public String getParseMode() {
return parseMode;
}
public InputMedia<T> setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (isNewMedia) {

View File

@ -16,6 +16,7 @@ public class InputMediaVideo extends InputMedia<InputMediaVideo> {
private static final String WIDTH_FIELD = "width";
private static final String HEIGHT_FIELD = "height";
private static final String DURATION_FIELD = "duration";
private static final String SUPPORTSSTREAMING_FIELD = "supports_streaming";
@JsonProperty(WIDTH_FIELD)
private int width; ///< Optional. Video width
@ -23,6 +24,8 @@ public class InputMediaVideo extends InputMedia<InputMediaVideo> {
private int height; ///< Optional. Video height
@JsonProperty(DURATION_FIELD)
private int duration; ///< Optional. Video duration
@JsonProperty(SUPPORTSSTREAMING_FIELD)
private Boolean supportsStreaming; ///< Optional. Pass True, if the uploaded video is suitable for streaming
public InputMediaVideo() {
super();

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>3.5</version>
<version>3.6</version>
<packaging>jar</packaging>
<name>Telegram Bots</name>
@ -66,7 +66,7 @@
<jackson.version>2.8.7</jackson.version>
<jacksonanotation.version>2.8.0</jacksonanotation.version>
<commonio.version>2.5</commonio.version>
<bots.version>3.5</bots.version>
<bots.version>3.6</bots.version>
</properties>
<dependencyManagement>

View File

@ -157,6 +157,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendDocument.getCaption() != null) {
builder.addTextBody(SendDocument.CAPTION_FIELD, sendDocument.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
if (sendDocument.getParseMode() != null) {
builder.addTextBody(SendDocument.PARSEMODE_FIELD, sendDocument.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
}
}
if (sendDocument.getDisableNotification() != null) {
builder.addTextBody(SendDocument.DISABLENOTIFICATION_FIELD, sendDocument.getDisableNotification().toString(), TEXT_PLAIN_CONTENT_TYPE);
@ -202,6 +205,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendPhoto.getCaption() != null) {
builder.addTextBody(SendPhoto.CAPTION_FIELD, sendPhoto.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
if (sendPhoto.getParseMode() != null) {
builder.addTextBody(SendPhoto.PARSEMODE_FIELD, sendPhoto.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
}
}
if (sendPhoto.getDisableNotification() != null) {
builder.addTextBody(SendPhoto.DISABLENOTIFICATION_FIELD, sendPhoto.getDisableNotification().toString(), TEXT_PLAIN_CONTENT_TYPE);
@ -247,6 +253,12 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendVideo.getCaption() != null) {
builder.addTextBody(SendVideo.CAPTION_FIELD, sendVideo.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
if (sendVideo.getParseMode() != null) {
builder.addTextBody(SendVideo.PARSEMODE_FIELD, sendVideo.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
}
}
if (sendVideo.getSupportsStreaming() != null) {
builder.addTextBody(SendVideo.SUPPORTSSTREAMING_FIELD, sendVideo.getSupportsStreaming().toString(), TEXT_PLAIN_CONTENT_TYPE);
}
if (sendVideo.getDuration() != null) {
builder.addTextBody(SendVideo.DURATION_FIELD, sendVideo.getDuration().toString(), TEXT_PLAIN_CONTENT_TYPE);
@ -408,6 +420,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendAudio.getCaption() != null) {
builder.addTextBody(SendAudio.CAPTION_FIELD, sendAudio.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
if (sendAudio.getParseMode() != null) {
builder.addTextBody(SendAudio.PARSEMODE_FIELD, sendAudio.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
}
}
HttpEntity multipart = builder.build();
httppost.setEntity(multipart);
@ -462,6 +477,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendVoice.getCaption() != null) {
builder.addTextBody(SendVoice.CAPTION_FIELD, sendVoice.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
if (sendVoice.getParseMode() != null) {
builder.addTextBody(SendVoice.PARSEMODE_FIELD, sendVoice.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
}
}
HttpEntity multipart = builder.build();
httppost.setEntity(multipart);