Git Product home page Git Product logo

telegrambot's Introduction

MantisBT TelegramBot Plugin

Join the chat at https://gitter.im/mantisbt-plugins/TelegramBot

Overview

This is a bot for the Telegram messenger.

Screenshots

alt text alt text alt text alt text alt text alt text

Features

  • Report bugs (v. >= 1.1);
  • Attach files to bugs;
  • Send comments to bugs;
  • Receive notification when (v. >= 1.2):
    • creating an bug;
    • change the status of the bug;
    • adding a comment to the bug;
    • mention of the user in the commentary.
  • Respond to chat alerts about events using the built-in function "Reply to message". The answer will be added as a comment to the bug (v. >= 1.3);
  • Support SOCKS5 proxy server ( Requires curl >= 7.21.7 ).

Download

Please download the stable version. (https://github.com/mantisbt-plugins/TelegramBot/releases/latest)

How to install

  1. Copy TelegramBot folder into plugins folder.
  2. Open Mantis with browser.
  3. Log in as administrator.
  4. Go to Manage -> Manage Plugins.
  5. Find TelegramBot in the list.
  6. Click Install.
  7. Click TelegramBot link
  8. Follow the instructions.

Supported Versions

  • MantisBT 2.14 to 2.26 - supported in plugin version up to 1.5.x
  • MantisBT 2.26 and higher - supported in plugin version 1.6 and higher
  • Only https ssl certificate signed trusted ca is supported for MantisBT ( In the near future, a self-signed https certificate will be supported. )

telegrambot's People

Contributors

brlumen avatar gitter-badger avatar manuel-jrs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telegrambot's Issues

unable to configure telegrambot

I followed instructions to install Telegrambot plugin. plugin was well installed and visible on the plugins board, however , clicking on the link to configure it , generated an error :

APPLICATION WARNING #100

Configuration option "plugin_TelegramBot_bot_name" not found. (in '/data/www/envtool-int.eurocontrol.fr/htdocs/mantis/core/config_api.php' line 191)

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section

Registration by PIN code

For mantisbt installations that do not have incoming access from the Internet and use crontab to receive updates from the telegram server, it is necessary to add the possibility of primary association of the telegram user and the mantisbt user by sending the user a PIN code.
The user enters the PIN code on a special mantisbt page and thus links his mantisbt account with his telegram account.

error creating defect in telegram_message_bug_added

I have integrated the testlink, mantis and the telegram bot.

When trying to create a defect in the testlink, it shows me an error in the log, indicating the following:

[Wed Sep 30 06:19:25.123920 2020] [:error] [pid 19504] [client 172.31.12.165:10648] [mantisconnect.php] Error Type: SYSTEM NOTICE,\nError Description: Undefined variable: p_bug_id\nStack Trace:\nUnknownFile L? telegram_message_bug_added('EVENT_REPORT_BUG', ( [attachment_count] => NULL, [bugnotes_count] => NULL ), 16)\nevent_api.php L206 call_user_func_array( { [0] => ( [name] => 'TelegramBot', [description] => 'Adds the user interaction function to the MantisBT via the Telegram messenger.', [page] => 'config_page', [version] => '1.5.0', [requires] => { ['MantisCore'] => '2.14.0' }, [uses] => NULL, [author] => 'Grigoriy Ermolaev', [contact] => '[email protected]', [url] => 'http://github.com/mantisbt-plugins/TelegramBot', [basename] => 'TelegramBot' ), [1] => 'telegram_message_bug_added' }, { [0] => 'EVENT_REPORT_BUG', [1] => ( [attachment_count] => NULL, [bugnotes_count] => NULL ), [2] => 16 })\nevent_api.php L232 event_callback('EVENT_REPORT_BUG', 'telegram_message_bug_added', 'TelegramBot', { [0] => ( [attachment_count] => NULL, [bugnotes_count] => NULL ), [1] => 16 })\nevent_api.php L164 event_type_execute('EVENT_REPORT_BUG', { ['TelegramBot'] => { [0] => 'telegram_message_bug_added' } }, { [0] => ( [attachment_count] => NULL, [bugnotes_count] => NULL ), [1] => 16 })\nIssueAddCommand.php L462 event_signal('EVENT_REPORT_BUG', { [0] => ( [attachment_count] => NULL, [bugnotes_count] => NULL ), [1] => 16 })\nCommand.php L137 process()\nmc_issue_api.php L946 execute()\nUnknownFile L? mc_issue_add('administrator', 'root', ( [project] => ( [id] => 1 ), [category] => 'General', [reporter] => ( [name] => 'admin' ), [summary] => '/TL20/Prueba/BT20-1:Prueba bot - Ejecutado EL (FORMATO ISO): 2020-09-29 07:13:46', [description] => 'fg' ))\nmantisconnect.php L89 handle()\n

[Wed Sep 30 06:19:25.125653 2020] [:error] [pid 20427] [client 172.31.26.20:60132] PHP Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Error Type: SYSTEM NOTICE,\nError Description: Undefined variable: p_bug_id in /var/www/html/TL201/lib/issuetrackerintegration/mantissoapInterface.class.php:461\nStack trace:\n#0 /var/www/html/TL201/lib/issuetrackerintegration/mantissoapInterface.class.php(461): SoapClient->__call('mc_issue_add', Array)\n#1 /var/www/html/TL201/lib/issuetrackerintegration/mantissoapInterface.class.php(461): SoapClient->mc_issue_add('administrator', 'root', Array)\n#2 /var/www/html/TL201/lib/functions/exec.inc.php(703): mantissoapInterface->addIssue('/TL20/Prueba/BT...', 'fg', Object(stdClass))\n#3 /var/www/html/TL201/lib/execute/bugAdd.php(38): addIssue(Object(database), Object(stdClass), Object(mantissoapInterface), Array)\n#4 {main}\n thrown in /var/www/html/TL201/lib/issuetrackerintegration/mantissoapInterface.class.php on line 461, referer: https://www.zmagadx.com/TL201/lib/execute/bugAdd.php?user_action=create&tcversion_id=5&tproject_id=1&tplan_id=2&exec_id=2&tcstep_id=0

error.log
testlink.log
access.log

Not notifying new issues

I've this working on Mantis 2.18 (later will upgrade to 2.19) and it doesn't notify me (admin) new issues, but it notifies when users add new comments.

Is this a known problem or I'm missing some config/adjustment?

Thanks!

Unable to use in mantis 2.24.1

I'm getting:

INTERNAL APPLICATION ERROR

When enter in the configuration page.

I tried to use:

$g_display_errors = array (
   E_ALL => DISPLAY_ERROR_INLINE,
  );

But the same message appears.

I am using mantis 2.24.1, is this version compatible?

Screenshots folow:

configuration page

Screenshot from 2020-05-12 10-14-53

Issue with custom fields without default value

In our setup we use several custom fields, all a required and several of them without default value.
Can you add support of it in bot?

I can't add a new issue in mantis via bot without filling of custom fields now. But they, sadly, are not supported.

TelegramBot cannot receive and show a list of Responsible people

Since May 2023 I have been using TelegramBot_2_0_0_dev_24_05_2023. You sent me this version individually. See the E-mail.

Версия MantisBT 2.25.7
Версия схемы 211
Версия PHP 7.3.33
Драйвер базы данных mysqli
Версия база данных, описание 10.11.2, 10.11.2-MariaDB

Something happened a couple of days ago. When creating a task, it cannot receive and show a list of Responsible people in the chat. After entering the the algorithm freezes, nothing happens in the Telegram chat.

I try to get out of the hang, enter any character in the input Field, the algorithm works further to the end.
Снимок экрана 2023-12-01 185354
I receive the created task as a new one without assigning anyone.

Errors
Снимок экрана 2023-12-01 111106

I switched on
$g_display_errors = array(

  • E_WARNING           => DISPLAY_ERROR_HALT,
    
  • E_ALL               => DISPLAY_ERROR_INLINE,
    
  • );
    Снимок экрана 2023-12-01 183924

In the /tmp/TelegramBot_debug.log file, there are 400 Bad Requests for these requests

< HTTP/1.1 400 Bad Request
< Server: nginx/1.18.0
< Date: Fri, 01 Dec 2023 08:01:35 GMT
< Content-Type: application/json
< Content-Length: 83
< Connection: keep-alive
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Content-Length,Content-Type,Date,Server,Connection

  • HTTP error before end of send, stop sending
    <
  • Closing connection 0

Is this due to the fact that the list of users is large - 187?
What could have happened?
How to fix it?

The rest of the Telegram Bot functionality works fine.

P.S.
A couple of days ago I tried to install a new version of Mantis 2.26. TelegramBot did not work. I rolled away. Showed an error by type INTERNAL APPLICATION ERROR #32

Is TelegramBot_2_0_0_dev_24_05_2023 compatible with Mantis 2.26?
Could Mantis 2.26 have written anything to the database?

Telegram returned an invalid response!

An error occurs if the IP address in the packet header transmitted from the mantisbt to the server side of the telegram does not match the IP address specified in the DNS for the mantisbt domain name.

Notification about attached file without text

Now, if you attach a file to a comment, but do not specify the text of the comment, the message will arrive without any text and without information about the file, only information about the fact that a note was added.

No system response when account is disabled

If the user has connected the telegram account to his account in MantisBT, after the administrator disconnects the user, the user will not receive anything in response when he tries to send a message.
Although when designing the bot, I took this into account and the user should be sent a message about the missing account or disabled.

Telegram returned an invalid response!

Hi there,

I just installed 1.3.3 and got that message. Looked at the Exception and got the info "Received invalid version in initial SOCKS5 response".
When I switch to 1.3.1 it works without problems.
Problem: Proxy is also set, when empty.

Support for version 2.18.0

Support for version 2.18.0
I installed the file TelegramBot-release-1.4.0 but, regrettably, it is not compatible with version 2.18.0, help, please!

Best regards...

Telegram returned an invalid response!

An error occurs if the IP address in the packet header transmitted from the mantisbt to the server side of the telegram does not match the IP address specified in the DNS for the mantisbt domain name.

PostgreSQL support

Hi!
As i understand from code, there is no support for postgresql .
Is it planned?

No response from bot now

> tail -f TelegramBot_debug.log





[2019-04-11 02:54:49] bot_log.DEBUG: Verbose HTTP Request output:
* Hostname was NOT found in DNS cache
*   Trying 132.148.13.46...
* Hostname was NOT found in DNS cache
* 149
* 154
* 167
* 220
* Connected to 132.148.13.46 (132.148.13.46) port 28602 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
*        subject: OU=Domain Control Validated; CN=api.telegram.org
*        start date: 2018-05-04 14:42:31 GMT
*        expire date: 2020-05-23 16:17:38 GMT
*        subjectAltName: api.telegram.org matched
*        issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
*        SSL certificate verify ok.
> POST /botXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/setWebhook HTTP/1.1
User-Agent: GuzzleHttp/6.3.3 curl/7.38.0 PHP/7.2.17
Content-Type: application/x-www-form-urlencoded
Host: api.telegram.org
Content-Length: 128

* upload completely sent off: 128 out of 128 bytes
< HTTP/1.1 200 OK
* Server nginx/1.12.2 is not blacklisted
< Server: nginx/1.12.2
< Date: Wed, 10 Apr 2019 23:54:49 GMT
< Content-Type: application/json
< Content-Length: 64
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, POST, OPTIONS
< Access-Control-Expose-Headers: Content-Length,Content-Type,Date,Server,Connection
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
<
* Connection #0 to host api.telegram.org left intact

 [] []

On settings page after saving changes i get a massage:

Telegram: Webhook is already set

But there is no reaction on messages from bot

Unable to select Project

I have 3 projects. When sending a message to the bot, he offers to start a task or add a comment, but does not offer to select a project. The first created project is always selected.

Create issue does nothing

When sending text to the bot, I have two options: Create issue and add note. When choosing the first one nothing happens, no other options offered. Adding a note asks for more options.

Debug log:

{"update_id":836342763, "callback_query":{"id":"586585762160892758","from":{"id":136575140,"is_bot":false,"first_name":"Jon","last_name":"Bonilla","username":"jbmanwe","language_code":"es"},"message":{"message_id":17,"from":{"id":863583925,"is_bot":true,"first_name":"ubsoporte","username":"ubsoporte_bot"},"chat":{"id":136575140,"first_name":"Jon","last_name":"Bonilla","username":"jbmanwe","type":"private"},"date":1557483165,"reply_to_message":{"message_id":16,"from":{"id":136575140,"is_bot":false,"first_name":"Jon","last_name":"Bonilla","username":"jbmanwe","language_code":"es"},"chat":{"id":136575140,"first_name":"Jon","last_name":"Bonilla","username":"jbmanwe","type":"private"},"date":1557483165,"text":"Echen"},"text":"Select an action from:"},"chat_instance":"-3778251224232573802","data":"{"rb":{"gp":{"id":0,"p":1,"fp":1}}}"}}
[2019-05-10 12:13:10] bot_log.DEBUG: Verbose HTTP Request output:

  • Expire in 0 ms for 6 (transfer 0x55b0b3003d30)
  • Expire in 30000 ms for 8 (transfer 0x55b0b3003d30)
  • Expire in 150000 ms for 2 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 1 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Expire in 0 ms for 1 (transfer 0x55b0b3003d30)
  • Trying 149.154.167.220...
  • TCP_NODELAY set
  • Expire in 15000 ms for 3 (transfer 0x55b0b3003d30)
  • Expire in 200 ms for 4 (transfer 0x55b0b3003d30)
  • Connected to api.telegram.org (149.154.167.220) port 443 (#0)
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: none
    CApath: /etc/ssl/certs
  • NPN, negotiated HTTP1.1
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  • ALPN, server did not agree to a protocol
  • Server certificate:
  • subject: OU=Domain Control Validated; CN=api.telegram.org
  • start date: May 4 14:42:31 2018 GMT
  • expire date: May 23 16:17:38 2020 GMT
  • subjectAltName: host "api.telegram.org" matched cert's "api.telegram.org"
  • issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
  • SSL certificate verify ok.

POST /bot863583925:AAF-2vQFFFFFFFFFFFFFFMhyubVr0/answerCallbackQuery HTTP/1.1
Host: api.telegram.org
User-Agent: GuzzleHttp/6.3.3 curl/7.64.0 PHP/7.3.4-2
Content-Type: application/x-www-form-urlencoded
Content-Length: 36

  • upload completely sent off: 36 out of 36 bytes
    < HTTP/1.1 200 OK
    < Server: nginx/1.12.2
    < Date: Fri, 10 May 2019 10:13:10 GMT
    < Content-Type: application/json
    < Content-Length: 25
    < Connection: keep-alive
    < Access-Control-Allow-Origin: *
    < Access-Control-Allow-Methods: GET, POST, OPTIONS
    < Access-Control-Expose-Headers: Content-Length,Content-Type,Date,Server,Connection
    < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
    <
  • Connection #0 to host api.telegram.org left intact

[] []

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.