|
ecasbot
1.3.1
EC AntiSpam bot for Telegram messenger
|
Public Member Functions | |
| def | __init__ (self, schid) |
| def | add_stopword |
| def | add_watch |
| def | admins (self) |
| def | bantime (self) |
| def | chkrgx (self) |
| def | fmterr (self) |
| def | fmtlog (self) |
| def | get_cfgpath (self) |
| def | get_watchers |
| def | load (self) |
| def | logtofile (self) |
| def | maxemoji (self) |
| def | maxname (self) |
| def | msggoal (self) |
| def | nickgoal (self) |
| def | remove_stopword |
| def | remove_watch |
| def | restent (self) |
| def | restricted_languages (self) |
| def | save (self) |
| def | stopwords (self) |
| def | stwrgx (self) |
| def | tgkey (self) |
| def | urlrgx (self) |
| def | watches (self) |
Static Public Member Functions | |
| def | get_logging_level () |
Private Member Functions | |
| def | __check_schema (self, schid) |
| def | __check_watchers |
| def | __find_cfgfile (self) |
Private Attributes | |
| __appname | |
| __cfgfile | |
| __data | |
| def ecasbot.settings.Settings.__init__ | ( | self, | |
| schid, | |||
| None | |||
| ) |
Main constructor of Settings class. :param schid: Required schema version.
|
private |
Check JSON config schema version. :param schid: New schema version. :return: True if equal.
|
private |
Get fully-qualified path to main configuration file.
| def ecasbot.settings.Settings.admins | ( | self, | |
| list | |||
| ) |
Get bot admins list. This users can execute any bot command and even control supergroups using special bot actions. :return: Bot admins list.
| def ecasbot.settings.Settings.bantime | ( | self, | |
| int | |||
| ) |
Get user ban time (in seconds). Bot will restrict new users for this time. :return: Restriction time.
| def ecasbot.settings.Settings.chkrgx | ( | self, | |
| str | |||
| ) |
Get regular expression for checking user names on joining supergroups. :return: Regex for user names checking.
| def ecasbot.settings.Settings.fmterr | ( | self, | |
| int | |||
| ) |
Get custom formatter for stderr (journald) logs. :return: Custom formatter for stderr logs.
| def ecasbot.settings.Settings.fmtlog | ( | self, | |
| int | |||
| ) |
Get custom formatter for file logs. :return: Custom formatter for text logs.
| def ecasbot.settings.Settings.get_cfgpath | ( | self, | |
| str | |||
| ) |
Get directory where bot's configuration are stored. User can override this setting by exporting CFGPATH environment option. :return: Full directory path.
|
static |
Get current log level. User can override this setting by exporting LOGLEVEL environment option. :return:
| def ecasbot.settings.Settings.load | ( | self, | |
| None | |||
| ) |
Load settings from JSON file.
| def ecasbot.settings.Settings.logtofile | ( | self, | |
| str | |||
| ) |
Get log file name. If not set or empty, stderr will be used. :return: Log file name.
| def ecasbot.settings.Settings.maxemoji | ( | self, | |
| int | |||
| ) |
Get maximum allowed emoji count in messages of new users. Bot will remove messages exceeding this limit. :return: Maximum emoji count in messages.
| def ecasbot.settings.Settings.maxname | ( | self, | |
| int | |||
| ) |
Get maximum allowed length of name. Bot will score users with very long names. :return: Maximum username length.
| def ecasbot.settings.Settings.msggoal | ( | self, | |
| int | |||
| ) |
Get number of score points after message checks required to delete it. :return: Maximum score points required.
| def ecasbot.settings.Settings.nickgoal | ( | self, | |
| int | |||
| ) |
Get number of score points after nickname checks required to block new joined user. :return: Maximum score points required.
| def ecasbot.settings.Settings.restent | ( | self, | |
| list | |||
| ) |
Get list of forbidden entitles for new users. Bot will remove any messages from restricted users contains any of it. :return: List of forbidden entitles.
| def ecasbot.settings.Settings.restricted_languages | ( | self, | |
| list | |||
| ) |
Get list of restricted languages. :return: Blocked langs list.
| def ecasbot.settings.Settings.save | ( | self, | |
| None | |||
| ) |
Save current settings to JSON file.
| def ecasbot.settings.Settings.stopwords | ( | self, | |
| list | |||
| ) |
Get list of forbidden words in nicknames of new users. Bot will score such users. :return: List of forbidden words in user names.
| def ecasbot.settings.Settings.stwrgx | ( | self, | |
| str | |||
| ) |
Get regular expression for checking forbidden words in nicknames or new messages. :return: Regex with forbidden words.
| def ecasbot.settings.Settings.tgkey | ( | self, | |
| str | |||
| ) |
Get Telegram Bot API token. :return: Bot API token.
| def ecasbot.settings.Settings.urlrgx | ( | self, | |
| str | |||
| ) |
Get regular expression for checking if string contains any URLs. :return: Regex for URL checking.
| def ecasbot.settings.Settings.watches | ( | self, | |
| list | |||
| ) |
Get watch list for reports feature. :return: Watch list.