Git Product home page Git Product logo

telegram-moderator's People

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

telegram-moderator's Issues

.exe messages get through

When there is bandwidth, could we have the bot immediately delete .exe files and ban the user. They are still getting through (saw a few this past week). Thanks ๐Ÿ™

Feature request: Muting

From Kevin Lee:

Muting is a function in Telegram

So we can mute somebody from talking in the group for 1 hour, 1 day, 1 week or forever

So maybe make it easier to mute like, typing a code

When we reply on certain message, the message we reply will be deleted and we get to choose how many hours they will be muted

In binance
Their bot will do it with this code

/pmute 70
(this is muting for 70 hours, also deleting the message they are replying to)

/mute 70 (muting for 70 hours only)

/pban (ban and delete message)

/ban (just banning)

logger.warning gives error

2018-01-29 07:14:24,477 - telegram.ext.updater - ERROR - Error while getting Updates: Timed out
2018-01-29 07:14:24,508 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while handling the error
Traceback (most recent call last):
  File "/Users/stan/Documents/Origin/origin-telegram-logger-bot/origin-telegram-logger-bot/lib/python2.7/site-packages/telegram/ext/dispatcher.py", line 271, in process_update
    self.dispatch_error(None, update)
  File "/Users/stan/Documents/Origin/origin-telegram-logger-bot/origin-telegram-logger-bot/lib/python2.7/site-packages/telegram/ext/dispatcher.py", line 384, in dispatch_error
    callback(self.bot, update, error)
  File "bot.py", line 92, in error
    logger.warning('Update "%s" caused error "%s"', update, error)
AttributeError: 'function' object has no attribute 'warning'

Bot features request from the CM team

Commands to be added
Price - /p
Chart - /c
Developement stats - /d
Social - /s <Reddit/Twitter/Medium>
Cir.Supply - /circsup

Here are examples on how to use the commands:

Price
Example:
/price
/p

Returns->
USD : $x
BTC : เธฟx
ETH : โ™ขx

Mkt Cap: $x
Volume : $x
24hr % : x%
7d % : x%
30d % : x%
1y % : x%
#Note: have the metrics be from the same source as in https://www.originprotocol.com/en/dashboard

Chart
Example:
/chart 7
/c 7

Returns->
image of the 7 day chart (source: coingecko perhaps)

Development Stats
Example:
/d
/dev

Returns->
Developer Data

Stars : x
Subscribers : x
Total Issues : x
Closed Issued : x
PR Merged : x
PR Contributors: x
4-wk Commit : x

Social Media Update
Example:
/s Twitter
/social Twitter

Returns->
Last twitter post

Circ.Supply
Example:
/circsup

Returns->
Circulating Supply: X OGN (same source as in the Dashboard)

Suggest to loosen the dependency on textblob

Hi, your project telegram-moderator(commit id: 4c7a662) requires "textblob==0.15.3" in its dependency. After analyzing the source code, we found that the following versions of textblob can also be suitable, i.e., textblob 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.17.0, 0.17.1, since all functions that you directly (1 APIs: textblob.blob.TextBlob.init) or indirectly (propagate to 5 textblob's internal APIs and 0 outsider APIs) used from the package have not been changed in these versions, thus not affecting your usage.

Therefore, we believe that it is quite safe to loose your dependency on textblob from "textblob==0.15.3" to "textblob>=0.9.0,<=0.17.1". This will improve the applicability of telegram-moderator and reduce the possibility of any further dependency conflict with other projects.

May I pull a request to further loosen the dependency on textblob?

By the way, could you please tell us whether such an automatic tool for dependency analysis may be potentially helpful for maintaining dependencies easier during your development?

Add periodic messages

A channel admin should be able to set a period message to be sent every N minutes.

/periodic [N minutes] My message

Discontinue

/periodicstop

A secondary request for this was adding CTA buttons. This may need to be split off into a separate issue.

Error causes bot to delete admin's messag

Seen with a forwarded message that was pinned to the channel by an admin:

155 <190>1 2020-05-10T19:42:10.212729+00:00 app worker.1 - - Error[292]: 'NoneType' object has no attribute 'from_user'
176 <190>1 2020-05-10T19:42:10.212766+00:00 app worker.1 - - Error on line 439 AttributeError 'NoneType' object has no attribute 'from_user'
138 <190>1 2020-05-10T19:42:13.572402+00:00 app worker.1 - - Expecting value: line 1 column 1 (char 0)
1237 <190>1 2020-05-10T19:42:13.580390+00:00 app worker.1 - - 2020-05-10T12:42:13 777000 (b'Telegram None') : b"\xf0\x9f\x8e\x8a At Origin we're grateful for the support we get from our loyal fans and community. If you would like to help us build and improve Origin, there are three main ways you can get involved:\n\n1. If you know how to read and write more than two languages, including English, you can be part of our team of translators at: https://crowdin.com/profile/OriginProtocol\n\n2. We are looking for people who are interested in testing Origin Deals. If you are planning to make a purchase on Origin Deals and would like to provide your feedback to one of our engineers in a 1-on-1 sessions please fill in the following form: https://docs.google.com/forms/d/e/1FAIpQLSeflisy6u6GG6r2YMPutyGl57eJvZ-cUjZAYzye_i-WGOa8qw/viewform?usp=send_form\n\n3. For all the developers out there, we invite you to participate in our open-source engineering process! Everyone is welcome. All you need to do is introduce yourself in our public Discord engineering channel, find an open issue in our monorepo and tell us that you would like to solve it. With that done you can merge your first pull request!"
1209 <190>1 2020-05-10T19:42:13.581265+00:00 app worker.1 - - โŒ HIDE FORWARDED: b"\xf0\x9f\x8e\x8a At Origin we're grateful for the support we get from our loyal fans and community. If you would like to help us build and improve Origin, there are three main ways you can get involved:\n\n1. If you know how to read and write more than two languages, including English, you can be part of our team of translators at: https://crowdin.com/profile/OriginProtocol\n\n2. We are looking for people who are interested in testing Origin Deals. If you are planning to make a purchase on Origin Deals and would like to provide your feedback to one of our engineers in a 1-on-1 sessions please fill in the following form: https://docs.google.com/forms/d/e/1FAIpQLSeflisy6u6GG6r2YMPutyGl57eJvZ-cUjZAYzye_i-WGOa8qw/viewform?usp=send_form\n\n3. For all the developers out there, we invite you to participate in our open-source engineering process! Everyone is welcome. All you need to do is introduce yourself in our public Discord engineering channel, find an open issue in our monorepo and tell us that you would like to solve it. With that done you can merge your first pull request!"
125 <190>1 2020-05-10T19:42:14.277485+00:00 app worker.1 - - Error[292]: Chat_id is empty
142 <190>1 2020-05-10T19:42:14.277527+00:00 app worker.1 - - Error on line 492 BadRequest Chat_id is empty
138 <190>1 2020-05-10T19:43:04.136559+00:00 app worker.1 - - Expecting value: line 1 column 1 (char 0)
1236 <190>1 2020-05-10T19:43:04.149970+00:00 app worker.1 - - 2020-05-10T12:43:04 [123456789] (b'[CENSORED]') : b"\xf0\x9f\x8e\x8a At Origin we're grateful for the support we get from our loyal fans and community. If you would like to help us build and improve Origin, there are three main ways you can get involved:\n\n1. If you know how to read and write more than two languages, including English, you can be part of our team of translators at: https://crowdin.com/profile/OriginProtocol\n\n2. We are looking for people who are interested in testing Origin Deals. If you are planning to make a purchase on Origin Deals and would like to provide your feedback to one of our engineers in a 1-on-1 sessions please fill in the following form: https://docs.google.com/forms/d/e/1FAIpQLSeflisy6u6GG6r2YMPutyGl57eJvZ-cUjZAYzye_i-WGOa8qw/viewform?usp=send_form\n\n3. For all the developers out there, we invite you to participate in our open-source engineering process! Everyone is welcome. All you need to do is introduce yourself in our public Discord engineering channel, find an open issue in our monorepo and tell us that you would like to solve it. With that done you can merge your first pull request!"
152 <190>1 2020-05-10T19:43:04.151494+00:00 app worker.1 - - ๐Ÿ‘ฎโ€โ™‚๏ธ Skipping checks. User is admin: [123456789]

Forwarded spam messages often get through

Been seeing a number of forwarded messages get through the bot. It seems to be the most common spam in the past 90 days. I wonder if the bot is able to detect all the text and multiple emoji's in forwarded messages as well.

Here is an example :
img_9748

More bot training

This got through the bot. ban "/?r=" as that is the referral code syntax?

image

feature request: delete join message

Hi

Chinese spam bots use join message as spam message. Would be great if name matching ban deletes join message as well. attaching screenshot
image

Regards

Community moderation

Allow community moderation whereby people can reply with /spam to any message. We'll keep track of how many times a message has been flagged and how many times a specific user has been reported. Moderators should be able to set custom thresholds for their communities above which messages should be automatically deleted and users should be banned.

Bot fails to ban users with empty first or last names

Soory not in git format, not familiar with it.

You should add this in bot.py so that users get really banned with no first or last name

def security_check_username(self, bot, update):
    """ Test username for security violations """
    if update.message.from_user.last_name is None:
            update.message.from_user.last_name = u''
    if update.message.from_user.first_name is None:
            update.message.from_user.first_name = u''

    full_name = (update.message.from_user.first_name + " "
        + update.message.from_user.last_name)

Add /everyone

Add an /everyone command to tag everyone in the channel.

Thinking an admin could send:

/everyone Hello, world!

Then the bot can delete the previous message and send

Hello, world!  @user1 @user2 @user3

Ignore messages not from group being logged

Right now the logger records every message the bot sees, even private messages sent right to it.

We should have a group name in config file and only log messages to that group.

CHAT_IDS in docs and error

Hi, CHAT_IDS would seem to need to go in the README somewhere as it doesn't seem possible to monitor a chat without it.

More importantly, I'm getting an error, which I've hacked the python code to see is being logged in logger at L218. This is after I've gotten it up and running, it's following my chat, and already saw it ignoring my chats as admin. Once I created a dummy user, all I would get was:

Bot started. Montitoring chats: [-1001242314436]
Error 1: must be str, not NoneType

Then, I guessed (by adding "1", "2" to the various error outputs, and discovering that it was at L219 where I stuck that) that some code in logger was dying because something was unpopulated. E.g., my user didn't have a username. I added that, and got further, only to get another error:

2018-03-04T00:06:56 566488256 (b'SP_telegram') : b'testing'
new
Error 1: must be str, not NoneType

Here's my heroku config anonymized with ...:

CHAT_IDS:                  ...
DATABASE_URL:              postgres://...
MESSAGE_BAN_PATTERNS:      testing_auto_admin_MBP
MESSAGE_HIDE_PATTERNS:     testing_auto_admin_MHP
NAME_BAN_PATTERNS:         testing_auto_admin_NBP
PAPERTRAIL_API_TOKEN:      ...
SAFE_USER_IDS:             testing_auto_admin_SUI
TELEGRAM_BOT_POSTGRES_URL: postgres://...
TELEGRAM_BOT_TOKEN:        ...

EDIT: I should add I saw "user added" for all my test users so far, so that seems to be working.

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.