Giter Site home page Giter Site logo

telegram-bot's People

Contributors

dependabot[bot] avatar e271828- avatar gaieges avatar hhio618 avatar mhasbini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

telegram-bot's Issues

Mock out tests

Current unit tests actually reach out to telegram, and require a valid key. Right now they're using some random bot account, but should instead not require a real key and mock out the tests instead.

Error during deployment

Hello there
When I want to deploy the bot
I get error two instances are running at same movement please help me with it!

We should cleanup the messages in the chatroom when they are no longer needed

The bot is spammy. We should delete messages after being posted.

Deleting messages feel like a good next move to address the bot dominating the channel.

Based on the official documentation: "A message can only be deleted if it was sent less than 48 hours ago".
Based on the suggested usage, I think this limitation will allow us to remove a good chunk of the messages after verification

Since captchas expire much faster we should be fine.

Take over running this bot

Need someone take over ownership of the running and maintenance of this bot.

  1. we have some outstanding issues
  2. We should launch it carefully in the hcaptcha telegram chat and work with owners on fixing UI rough edges

Bot reacts to all unknown commands, even targeted at other bots.

testuser, [04.09.20 22:29]
/test

hCaptchaBot, [04.09.20 22:29]
Sorry, didn't recognize this command:
/test

hCaptchaBot, [04.09.20 22:29]
Available commands:

/hi - check your status or verify yourself
/restrict <supergroup> - restrict newly joined users in <supergroup>. bot should have admin permissions.

testuser, [04.09.20 22:29]
/test@testbot

hCaptchaBot, [04.09.20 22:29]
Sorry, didn't recognize this command:
/test@testbot

hCaptchaBot, [04.09.20 22:29]
Available commands:

/hi - check your status or verify yourself
/restrict <supergroup> - restrict newly joined users in <supergroup>. bot should have admin permissions.

Telegram bots shouldn't react to any command not targeted at them, or an unknown command not targeted to a particular one. This makes using this bot while having another bot on a channel very, very cumbersome.

Close hanging transactions

Few places where we leave open many connections to the db as indicated by:

$ heroku pg:ps --remote staging
  pid  |        state        | source |    username    |   running_for   |       transaction_start       | waiting |                                                                                                   query
-------+---------------------+--------+----------------+-----------------+-------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 31479 | idle in transaction |        | keoguvuxlyqnts | 00:18:13.381006 | 2020-10-29 22:47:14.225349+00 | t       | SELECT messages.id AS messages_id, messages.user_id AS messages_user_id, messages.chat_id AS messages_chat_id, messages.message_id AS messages_message_id, messages.created_date AS messages_created_date +
       |                     |        |                |                 |                               |         | FROM messages                                                                                                                                                                                             +
       |                     |        |                |                 |                               |         | WHERE messages.created_date <= '2020-10-29T23:02:16.844205'::timestamp
 31478 | idle in transaction |        | keoguvuxlyqnts | 00:18:13.585231 | 2020-10-29 22:47:14.021124+00 | t       | SELECT messages.id AS messages_id, messages.user_id AS messages_user_id, messages.chat_id AS messages_chat_id, messages.message_id AS messages_message_id, messages.created_date AS messages_created_date +
       |                     |        |                |                 |                               |         | FROM messages                                                                                                                                                                                             +
       |                     |        |                |                 |                               |         | WHERE messages.created_date <= '2020-10-29T23:02:16.677969'::timestamp
 19092 | idle in transaction |        | keoguvuxlyqnts | 05:22:02.090353 | 2020-10-29 17:43:25.516002+00 | t       | SELECT messages.id AS messages_id, messages.user_id AS messages_user_id, messages.chat_id AS messages_chat_id, messages.message_id AS messages_message_id, messages.created_date AS messages_created_date +
       |                     |        |                |                 |                               |         | FROM messages                                                                                                                                                                                             +
       |                     |        |                |                 |                               |         | WHERE messages.created_date <= '2020-10-29T23:01:51.706861'::timestamp
 26644 | idle in transaction |        | keoguvuxlyqnts | 00:49:48.350257 | 2020-10-29 22:15:39.256098+00 | t       | SELECT messages.id AS messages_id, messages.user_id AS messages_user_id, messages.chat_id AS messages_chat_id, messages.message_id AS messages_message_id, messages.created_date AS messages_created_date +
       |                     |        |                |                 |                               |         | FROM messages                                                                                                                                                                                             +
       |                     |        |                |                 |                               |         | WHERE messages.created_date <= '2020-10-29T23:00:42.551756'::timestamp
  4304 | idle in transaction |        | keoguvuxlyqnts | 03:08:25.218032 | 2020-10-29 19:57:02.388323+00 | t       | SELECT messages.id AS messages_id, messages.user_id AS messages_user_id, messages.chat_id AS messages_chat_id, messages.message_id AS messages_message_id, messages.created_date AS messages_created_date +
       |                     |        |                |                 |                               |         | FROM messages                                                                                                                                                                                             +
       |                     |        |                |                 |                               |         | WHERE messages.created_date <= '2020-10-29T23:00:16.607548'::timestamp
 31140 | idle in transaction |        | keoguvuxlyqnts | 00:20:27.888331 | 2020-10-29 22:44:59.718024+00 | t       | SELECT channels.id AS channels_id, channels.chat_id AS channels_chat_id, channels.restrict AS channels_restrict, channels.name AS channels_name                                                           +
       |                     |        |                |                 |                               |         | FROM channels                                                                                                                                                                                             +
       |                     |        |                |                 |                               |         | WHERE channels.chat_id = '1108918469'

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.