ecasbot  1.3.1
EC AntiSpam bot for Telegram messenger
ecasbot.ASBot Class Reference

Public Member Functions

None __init__ (self)
 
None runbot (self)
 

Public Attributes

 bot
 

Private Member Functions

bool __check_admin_feature (self, message)
 
bool __check_message_entities (self, message)
 
bool __check_message_forward (self, message)
 
bool __check_message_spam (self, message)
 
bool __check_owner_feature (self, message)
 
bool __check_private_chat (self, message)
 
bool __check_restricted_user (self, message)
 
bool __check_user_admin (self, userid, chatid)
 
str __get_actual_userid (self, message)
 
str __get_actual_username (self, message)
 
str __get_message_link (self, message)
 
None __notify_admin (self, message, logstr)
 
int __score_message (self, message)
 
int __score_user (self, account)
 

Private Attributes

 __logger
 
 __msgs
 
 __schema
 
 __settings
 

Constructor & Destructor Documentation

◆ __init__()

None ecasbot.ASBot.__init__ (   self)
Main constructor of ASBot class.

Member Function Documentation

◆ __check_admin_feature()

bool ecasbot.ASBot.__check_admin_feature (   self,
  message 
)
private
Check if message was sent by user with admin rights in supergroup.
:param message: Message to check.
:return: Check results.

◆ __check_message_entities()

bool ecasbot.ASBot.__check_message_entities (   self,
  message 
)
private
Check if current message contains restricted entitles.
:param message: Message to check.
:return: Check results.

◆ __check_message_forward()

bool ecasbot.ASBot.__check_message_forward (   self,
  message 
)
private
Check if current message was forwarded from another chat.
:param message: Message to check.
:return: Check results.

◆ __check_message_spam()

bool ecasbot.ASBot.__check_message_spam (   self,
  message 
)
private
Check if current message contains spam.
:param message: Message to check.
:return: Check results.

◆ __check_owner_feature()

bool ecasbot.ASBot.__check_owner_feature (   self,
  message 
)
private
Check if message was sent by bot admin in private chat.
:param message: Message to check.
:return: Check results.

◆ __check_private_chat()

bool ecasbot.ASBot.__check_private_chat (   self,
  message 
)
private
Check if message was sent in private chat.
:param message: Message to check.
:return: Check results.

◆ __check_restricted_user()

bool ecasbot.ASBot.__check_restricted_user (   self,
  message 
)
private
Check if message was sent by a restricted user in supergroup.
:param message: Message to check.
:return: Check results.

◆ __check_user_admin()

bool ecasbot.ASBot.__check_user_admin (   self,
  userid,
  chatid 
)
private
Check if specified user has admin rights in specified supergroup.
:param userid: User ID to check.
:param chatid: Supergroup ID.
:return: Check results.

◆ __get_actual_userid()

str ecasbot.ASBot.__get_actual_userid (   self,
  message 
)
private
Get a real ID of current message's sender.
:param message: Message to check.
:return: Real ID.

◆ __get_actual_username()

str ecasbot.ASBot.__get_actual_username (   self,
  message 
)
private
Get a real username of current message's sender.
:param message: Message to check.
:return: Real username.

◆ __get_message_link()

str ecasbot.ASBot.__get_message_link (   self,
  message 
)
private
Generate full URL to specified message.
:param message: Message to process.
:return: Full URL.

◆ __notify_admin()

None ecasbot.ASBot.__notify_admin (   self,
  message,
  logstr 
)
private
Notify admin about event if subscribed.
:param message: Original message, raised event.
:param logstr: Message with useful information.

◆ __score_message()

int ecasbot.ASBot.__score_message (   self,
  message 
)
private
Check current message and score it.
:param message: Message to check.
:return: Score results.

◆ __score_user()

int ecasbot.ASBot.__score_user (   self,
  account 
)
private
Check current user's profile and score him.
:param account: User ID (from API).
:return: Score results.

◆ runbot()

None ecasbot.ASBot.runbot (   self)
Run bot forever.