From a422f6b0e83072c0f6e27d28d0d9edf00ca1d50a Mon Sep 17 00:00:00 2001 From: starry69 Date: Fri, 28 Aug 2020 09:47:09 +0530 Subject: [PATCH 01/25] Translateor: add translation from media caption support Signed-off-by: starry69 --- SaitamaRobot/modules/gtranslator.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SaitamaRobot/modules/gtranslator.py b/SaitamaRobot/modules/gtranslator.py index 34bc29a2d3..a8614db783 100644 --- a/SaitamaRobot/modules/gtranslator.py +++ b/SaitamaRobot/modules/gtranslator.py @@ -14,10 +14,13 @@ def totranslate(update: Update, context: CallbackContext): if "-" in key: problem_lang_code.append(key) try: - if msg.reply_to_message and msg.reply_to_message.text: - + if msg.reply_to_message: args = update.effective_message.text.split(None, 1) - text = msg.reply_to_message.text + if msg.reply_to_message.text: + text = msg.reply_to_message.text + elif msg.reply_to_message.caption: + text = msg.reply_to_message.caption + message = update.effective_message dest_lang = None From 55927d10f2b92a9d1173bace4c8f64ff23dcb105 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 19:05:00 +0530 Subject: [PATCH 02/25] Update start response --- SaitamaRobot/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SaitamaRobot/__main__.py b/SaitamaRobot/__main__.py index 343eb0cfeb..fd7668c742 100644 --- a/SaitamaRobot/__main__.py +++ b/SaitamaRobot/__main__.py @@ -165,7 +165,7 @@ def start(update: Update, context: CallbackContext): context.bot.username)) ]])) else: - update.effective_message.reply_text("Yo, whadup?") + update.effective_message.reply_text("I am already online!") # for test purposes From f4ade3c39f6324d62b0a6defd6509732b5d68678 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 19:08:55 +0530 Subject: [PATCH 03/25] [antiflood] Update flood action response --- SaitamaRobot/modules/antiflood.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SaitamaRobot/modules/antiflood.py b/SaitamaRobot/modules/antiflood.py index 8ba1e7492a..54dd6e0ff0 100644 --- a/SaitamaRobot/modules/antiflood.py +++ b/SaitamaRobot/modules/antiflood.py @@ -74,9 +74,7 @@ def check_flood(update, context) -> str: execstrings = ("Muted for {}".format(getvalue)) tag = "TMUTE" send_message( - update.effective_message, - "Wonderful, I like to leave flooding to natural disasters but you, " - "you were just a disappointment {}!".format(execstrings)) + update.effective_message,"Beep Boop! Boop Beep!\n{}!".format(execstrings)) return "{}:" \ "\n#{}" \ From 2847a98e5c9eb652a25d7205cd5933f7c30de44f Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 20:25:33 +0530 Subject: [PATCH 04/25] [gbans] ??? Status for Disasters --- SaitamaRobot/modules/global_bans.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SaitamaRobot/modules/global_bans.py b/SaitamaRobot/modules/global_bans.py index f8a8d8dd3a..15b7b28f09 100644 --- a/SaitamaRobot/modules/global_bans.py +++ b/SaitamaRobot/modules/global_bans.py @@ -467,6 +467,8 @@ def __user_info__(user_id): is_gbanned = sql.is_user_gbanned(user_id) text = "Globally banned: {}" + if int(user_id) in SUDO_USERS + SUPPORT_USERS + TIGER_USERS + WHITELIST_USERS: + text = text.format("???") if is_gbanned: text = text.format("Yes") user = sql.get_gbanned_user(user_id) @@ -519,4 +521,4 @@ def __chat_settings__(chat_id, user_id): if STRICT_GBAN: # enforce GBANS if this is set dispatcher.add_handler(GBAN_ENFORCER, GBAN_ENFORCE_GROUP) - __handlers__.append((GBAN_ENFORCER, GBAN_ENFORCE_GROUP)) + __handlers__.append((GBAN_ENFORCER, GBAN_ENFORCE_GROUP)) \ No newline at end of file From bf66288c00f1375acf297196769128eff822c4e7 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 20:29:12 +0530 Subject: [PATCH 05/25] [blacklist] ??? Status for Disasters --- SaitamaRobot/modules/blacklistusers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SaitamaRobot/modules/blacklistusers.py b/SaitamaRobot/modules/blacklistusers.py index 1b196a6236..6d1c963e81 100644 --- a/SaitamaRobot/modules/blacklistusers.py +++ b/SaitamaRobot/modules/blacklistusers.py @@ -1,7 +1,7 @@ # Module to blacklist users and prevent them from using commands by @TheRealPhoenix import SaitamaRobot.modules.sql.blacklistusers_sql as sql -from SaitamaRobot import (DEV_USERS, OWNER_ID, SUDO_USERS, SUPPORT_USERS, +from SaitamaRobot import (DEV_USERS, OWNER_ID, SUDO_USERS, SUPPORT_USERS, TIGER_USERS, WHITELIST_USERS, dispatcher) from SaitamaRobot.modules.helper_funcs.chat_status import dev_plus from SaitamaRobot.modules.helper_funcs.extraction import (extract_user, @@ -132,7 +132,8 @@ def __user_info__(user_id): is_blacklisted = sql.is_user_blacklisted(user_id) text = "Blacklisted: {}" - + if int(user_id) in SUDO_USERS + SUPPORT_USERS + TIGER_USERS + WHITELIST_USERS: + text = text.format("???") if is_blacklisted: text = text.format("Yes") reason = sql.get_reason(user_id) From 872135c34f7f6b88f91548188aa8368eca6cc7e1 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 20:30:16 +0530 Subject: [PATCH 06/25] [blacklist][gbans] Minor optional tuneup --- SaitamaRobot/modules/blacklistusers.py | 2 +- SaitamaRobot/modules/global_bans.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SaitamaRobot/modules/blacklistusers.py b/SaitamaRobot/modules/blacklistusers.py index 6d1c963e81..e53543b388 100644 --- a/SaitamaRobot/modules/blacklistusers.py +++ b/SaitamaRobot/modules/blacklistusers.py @@ -132,7 +132,7 @@ def __user_info__(user_id): is_blacklisted = sql.is_user_blacklisted(user_id) text = "Blacklisted: {}" - if int(user_id) in SUDO_USERS + SUPPORT_USERS + TIGER_USERS + WHITELIST_USERS: + if int(user_id) in SUDO_USERS + TIGER_USERS + WHITELIST_USERS: text = text.format("???") if is_blacklisted: text = text.format("Yes") diff --git a/SaitamaRobot/modules/global_bans.py b/SaitamaRobot/modules/global_bans.py index 15b7b28f09..2ce760198a 100644 --- a/SaitamaRobot/modules/global_bans.py +++ b/SaitamaRobot/modules/global_bans.py @@ -467,7 +467,7 @@ def __user_info__(user_id): is_gbanned = sql.is_user_gbanned(user_id) text = "Globally banned: {}" - if int(user_id) in SUDO_USERS + SUPPORT_USERS + TIGER_USERS + WHITELIST_USERS: + if int(user_id) in SUDO_USERS + TIGER_USERS + WHITELIST_USERS: text = text.format("???") if is_gbanned: text = text.format("Yes") From ba9d629011cf7438f8a6a781735ec3523777a00d Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 20:40:59 +0530 Subject: [PATCH 07/25] [blacklist][gbans] Minor improvement tuneup --- SaitamaRobot/modules/blacklistusers.py | 1 + SaitamaRobot/modules/global_bans.py | 1 + 2 files changed, 2 insertions(+) diff --git a/SaitamaRobot/modules/blacklistusers.py b/SaitamaRobot/modules/blacklistusers.py index e53543b388..5f719c1410 100644 --- a/SaitamaRobot/modules/blacklistusers.py +++ b/SaitamaRobot/modules/blacklistusers.py @@ -134,6 +134,7 @@ def __user_info__(user_id): text = "Blacklisted: {}" if int(user_id) in SUDO_USERS + TIGER_USERS + WHITELIST_USERS: text = text.format("???") + return text if is_blacklisted: text = text.format("Yes") reason = sql.get_reason(user_id) diff --git a/SaitamaRobot/modules/global_bans.py b/SaitamaRobot/modules/global_bans.py index 2ce760198a..addcadb1e8 100644 --- a/SaitamaRobot/modules/global_bans.py +++ b/SaitamaRobot/modules/global_bans.py @@ -469,6 +469,7 @@ def __user_info__(user_id): text = "Globally banned: {}" if int(user_id) in SUDO_USERS + TIGER_USERS + WHITELIST_USERS: text = text.format("???") + return text if is_gbanned: text = text.format("Yes") user = sql.get_gbanned_user(user_id) From ca13f09af7361b7507c82ab06f3420ead79af61d Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 20:46:52 +0530 Subject: [PATCH 08/25] Use is instead of == where for bool --- SaitamaRobot/modules/backups.py | 4 ++-- SaitamaRobot/modules/connection.py | 2 +- SaitamaRobot/modules/cust_filters.py | 6 +++--- SaitamaRobot/modules/sql/connection_sql.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SaitamaRobot/modules/backups.py b/SaitamaRobot/modules/backups.py index fedbb4e596..9650f58143 100644 --- a/SaitamaRobot/modules/backups.py +++ b/SaitamaRobot/modules/backups.py @@ -70,7 +70,7 @@ def import_data(update, context): # Check if backup is this chat try: - if data.get(str(chat.id)) == None: + if data.get(str(chat.id)) is None: if conn: text = "Backup comes from another chat, I can't return another chat to chat *{}*".format( chat_name) @@ -347,7 +347,7 @@ def export_data(update, context): # Temporary data def put_chat(chat_id, value, chat_data): # print(chat_data) - if value == False: + if value is False: status = False else: status = True diff --git a/SaitamaRobot/modules/connection.py b/SaitamaRobot/modules/connection.py index 64045c8ef3..d8ba3b03ed 100644 --- a/SaitamaRobot/modules/connection.py +++ b/SaitamaRobot/modules/connection.py @@ -263,7 +263,7 @@ def connected(bot: Bot, update: Update, chat, user_id, need_admin=True): if ((isadmin) or (isallow and ismember) or (user.id in SUDO_USERS) or (user.id in DEV_USERS)): - if need_admin == True: + if need_admin is True: if (getstatusadmin.status in ("administrator", "creator") or user_id in SUDO_USERS or user.id in DEV_USERS): return conn_id diff --git a/SaitamaRobot/modules/cust_filters.py b/SaitamaRobot/modules/cust_filters.py index c879c7c84a..f53d5e3dea 100644 --- a/SaitamaRobot/modules/cust_filters.py +++ b/SaitamaRobot/modules/cust_filters.py @@ -54,7 +54,7 @@ def list_handlers(update, context): user = update.effective_user conn = connected(context.bot, update, chat, user.id, need_admin=False) - if not conn == False: + if not conn is False: chat_id = conn chat_name = dispatcher.bot.getChat(conn).title filter_list = "*Filter in {}:*\n" @@ -105,7 +105,7 @@ def filters(update, context): 1) # use python's maxsplit to separate Cmd, keyword, and reply_text conn = connected(context.bot, update, chat, user.id) - if not conn == False: + if not conn is False: chat_id = conn chat_name = dispatcher.bot.getChat(conn).title else: @@ -223,7 +223,7 @@ def stop_filter(update, context): args = update.effective_message.text.split(None, 1) conn = connected(context.bot, update, chat, user.id) - if not conn == False: + if not conn is False: chat_id = conn chat_name = dispatcher.bot.getChat(conn).title else: diff --git a/SaitamaRobot/modules/sql/connection_sql.py b/SaitamaRobot/modules/sql/connection_sql.py index c6ac0543f7..f4e19b106a 100644 --- a/SaitamaRobot/modules/sql/connection_sql.py +++ b/SaitamaRobot/modules/sql/connection_sql.py @@ -192,7 +192,7 @@ def __load_user_history(): HISTORY_CONNECT = {} for x in qall: check = HISTORY_CONNECT.get(x.user_id) - if check == None: + if check is None: HISTORY_CONNECT[x.user_id] = {} HISTORY_CONNECT[x.user_id][x.conn_time] = { "chat_name": x.chat_name, From e601b813f602743a141bd680d0d10e2004519964 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 20:57:47 +0530 Subject: [PATCH 09/25] Minor edit to start text --- SaitamaRobot/__main__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SaitamaRobot/__main__.py b/SaitamaRobot/__main__.py index fd7668c742..6d764f418b 100644 --- a/SaitamaRobot/__main__.py +++ b/SaitamaRobot/__main__.py @@ -36,10 +36,9 @@ the things I can help you with. *Main* commands available: - • /start: start the bot • /help: PM's you this message. • /help : PM's you info about that module. - • /donate: information about how to donate! + • /donate: information on how to donate! • /settings: • in PM: will send you your settings for all supported modules. • in a group: will redirect you to pm, with all that chat's settings. From fb2a3ab555e06b995cf6b8026a50325477abea18 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 21:46:10 +0530 Subject: [PATCH 10/25] Improvements to help menu --- SaitamaRobot/modules/blacklist_stickers.py | 2 +- SaitamaRobot/modules/currency_converter.py | 11 --------- SaitamaRobot/modules/disasters.py | 25 +++++++++++++++++-- SaitamaRobot/modules/fun.py | 12 ++++++---- SaitamaRobot/modules/misc.py | 28 ++++++++++++++++++---- SaitamaRobot/modules/paste.py | 5 ---- SaitamaRobot/modules/ping.py | 6 ----- SaitamaRobot/modules/reactions.py | 6 ----- SaitamaRobot/modules/shout.py | 15 ------------ SaitamaRobot/modules/ud.py | 5 ---- SaitamaRobot/modules/userinfo.py | 24 +++++++++++++++---- SaitamaRobot/modules/users.py | 6 ++--- SaitamaRobot/modules/weebify.py | 5 ---- SaitamaRobot/modules/wiki.py | 8 ------- 14 files changed, 77 insertions(+), 81 deletions(-) diff --git a/SaitamaRobot/modules/blacklist_stickers.py b/SaitamaRobot/modules/blacklist_stickers.py index 449c81bc2b..7c950e967b 100644 --- a/SaitamaRobot/modules/blacklist_stickers.py +++ b/SaitamaRobot/modules/blacklist_stickers.py @@ -476,7 +476,7 @@ def __stats__(): • `` can be `https://t.me/addstickers/` or just `` or reply to the sticker message. """ -__mod_name__ = "Sticker Blacklist" +__mod_name__ = "Stickers Blacklist" BLACKLIST_STICKER_HANDLER = DisableAbleCommandHandler( "blsticker", blackliststicker, admin_ok=True) diff --git a/SaitamaRobot/modules/currency_converter.py b/SaitamaRobot/modules/currency_converter.py index e9abafc4a4..e7bffe96a1 100644 --- a/SaitamaRobot/modules/currency_converter.py +++ b/SaitamaRobot/modules/currency_converter.py @@ -46,20 +46,9 @@ def convert(update: Update, context: CallbackContext): parse_mode=ParseMode.MARKDOWN) -__help__ = """ - • `/cash`*:* currency converter - - *Example syntax:* - `/cash 1 USD INR` _OR_ `/cash 1 usd inr` - - *Output:* `1.0 USD = 75.505 INR` - -""" - CONVERTER_HANDLER = CommandHandler('cash', convert) dispatcher.add_handler(CONVERTER_HANDLER) -__mod_name__ = "Currency Converter" __command_list__ = ["cash"] __handlers__ = [CONVERTER_HANDLER] diff --git a/SaitamaRobot/modules/disasters.py b/SaitamaRobot/modules/disasters.py index 3999d5c0dd..f0a56a2c12 100644 --- a/SaitamaRobot/modules/disasters.py +++ b/SaitamaRobot/modules/disasters.py @@ -529,13 +529,34 @@ def devlist(update: Update, context: CallbackContext): __help__ = f""" +*⚠️ Notice:* +Commands listed here only work for users with special access are mainly used for troubleshooting, debugging purposes. +Group admins/group owners do not need these commands. + • `/heroes`*:* Lists all Hero Association members. • `/dragons`*:* Lists all Dragon disasters. • `/demons`*:* Lists all Demon disasters. • `/tigers`*:* Lists all Tigers disasters. • `/wolves`*:* Lists all Wolf disasters. - *Note:* These commands list users with special bot priveleges and can only be used by them. - You can visit {SUPPORT_CHAT} to query more about these. + +*Ping:* + • `/ping`*:* gets ping time of bot to telegram server + • `/pingall`*:* gets all listed ping times + +*Broadcast: (Bot owner only)* +Note: This supports basic markdown + • `/broadcastall messagehere`*:* Broadcasts the message everywhere. + • `/broadcastusers messagehere`*:* Broadcasts the message too all users of the bot. + • `/broadcastgroups messagehere`*:* Broadcasts the message too all groups of the bot. + +*Getchats:* + • `/getchats ID`*:* Gets a list of group names the user has been seen in. Bot owner only. + +*Blacklist:* + • `/ignore`*:* Blacklists a user from using the bot entirely. + • `/notice`*:* Whitelists the user to allow bot usage. + +You can visit {SUPPORT_CHAT} if you want details on these. """ SUDO_HANDLER = CommandHandler(("addsudo", "adddragon"), addsudo) diff --git a/SaitamaRobot/modules/fun.py b/SaitamaRobot/modules/fun.py index c7cbdc92b2..8990cf4070 100644 --- a/SaitamaRobot/modules/fun.py +++ b/SaitamaRobot/modules/fun.py @@ -120,15 +120,17 @@ def table(update: Update, context: CallbackContext): __help__ = """ - • `/runs`*:* reply a random string from an array of replies. - • `/slap`*:* slap a user, or get slapped if not a reply. - • `/shrug`*:* get shrug XD. - • `/table`*:* get flip/unflip :v. + • `/runs`*:* reply a random string from an array of replies + • `/slap`*:* slap a user, or get slapped if not a reply + • `/shrug`*:* get shrug XD + • `/table`*:* get flip/unflip :v • `/decide`*:* Randomly answers yes/no/maybe • `/toss`*:* Tosses A coin • `/bluetext`*:* check urself :V - • `/roll`*:* Roll a dice. + • `/roll`*:* Roll a dice • `/rlg`*:* Join ears,nose,mouth and create an emo ;-; + • `/shout `*:* write anything you want to give loud shout + • `/weebify `*:* returns a weebified text """ RUNS_HANDLER = DisableAbleCommandHandler("runs", runs) diff --git a/SaitamaRobot/modules/misc.py b/SaitamaRobot/modules/misc.py index fd46840880..ced25dfd9b 100644 --- a/SaitamaRobot/modules/misc.py +++ b/SaitamaRobot/modules/misc.py @@ -217,10 +217,28 @@ def stats(update: Update, context: CallbackContext): __help__ = """ - • `/id`*:* get the current group id. If used by replying to a message, gets that user's id. - • `/gifid`*:* reply to a gif to me to tell you its file ID. - • `/info`*:* get information about a user. - • `/markdownhelp`*:* quick summary of how markdown works in telegram - can only be called in private chats. +*Available commands:* +*Markdown:* + • `/markdownhelp`*:* quick summary of how markdown works in telegram - can only be called in private chats +*Paste:* + • `/paste`*:* Saves replied content to `neko.bin` and replies with a url +*React:* + • `/react`*:* Reacts with a random reaction +*Urban Dictonary:* + • `/ud `*:* Type the word or expression you want to search use +*Wikipedia:* + • `/wiki `*:* wikipedia your query + +*Currency converter:* + • `/cash`*:* currency converter + +Example: + `/cash 1 USD INR` + _OR_ + `/cash 1 usd inr` + + Output: `1.0 USD = 75.505 INR` + """ ID_HANDLER = DisableAbleCommandHandler("id", get_id) @@ -238,7 +256,7 @@ def stats(update: Update, context: CallbackContext): dispatcher.add_handler(MD_HELP_HANDLER) dispatcher.add_handler(STATS_HANDLER) -__mod_name__ = "Misc" +__mod_name__ = "Extras" __command_list__ = ["id", "info", "echo"] __handlers__ = [ ID_HANDLER, GIFID_HANDLER, INFO_HANDLER, ECHO_HANDLER, MD_HELP_HANDLER, diff --git a/SaitamaRobot/modules/paste.py b/SaitamaRobot/modules/paste.py index f50a29d813..131a5564a2 100644 --- a/SaitamaRobot/modules/paste.py +++ b/SaitamaRobot/modules/paste.py @@ -35,13 +35,8 @@ def paste(update: Update, context: CallbackContext): disable_web_page_preview=True) -__help__ = """ - • `/paste`*:* Do a paste at `neko.bin` -""" - PASTE_HANDLER = DisableAbleCommandHandler("paste", paste) dispatcher.add_handler(PASTE_HANDLER) -__mod_name__ = "Paste" __command_list__ = ["paste"] __handlers__ = [PASTE_HANDLER] diff --git a/SaitamaRobot/modules/ping.py b/SaitamaRobot/modules/ping.py index 390154cd0e..2efefda252 100644 --- a/SaitamaRobot/modules/ping.py +++ b/SaitamaRobot/modules/ping.py @@ -102,17 +102,11 @@ def pingall(update: Update, context: CallbackContext): reply_msg, parse_mode=ParseMode.HTML, disable_web_page_preview=True) -__help__ = """ - • `/ping`*:* get ping time of bot to telegram server - • `/pingall`*:* get all listed ping time -""" - PING_HANDLER = DisableAbleCommandHandler("ping", ping) PINGALL_HANDLER = DisableAbleCommandHandler("pingall", pingall) dispatcher.add_handler(PING_HANDLER) dispatcher.add_handler(PINGALL_HANDLER) -__mod_name__ = "Ping" __command_list__ = ["ping", "pingall"] __handlers__ = [PING_HANDLER, PINGALL_HANDLER] diff --git a/SaitamaRobot/modules/reactions.py b/SaitamaRobot/modules/reactions.py index 14270e4a1f..a4845d0480 100644 --- a/SaitamaRobot/modules/reactions.py +++ b/SaitamaRobot/modules/reactions.py @@ -58,15 +58,9 @@ def react(update: Update, context: CallbackContext): else: message.reply_text(react) - -__help__ = """ - • `/react`*:* Reacts with a random reaction -""" - REACT_HANDLER = DisableAbleCommandHandler("react", react) dispatcher.add_handler(REACT_HANDLER) -__mod_name__ = "React" __command_list__ = ["react"] __handlers__ = [REACT_HANDLER] diff --git a/SaitamaRobot/modules/shout.py b/SaitamaRobot/modules/shout.py index f1f5c93424..0d868cdd90 100644 --- a/SaitamaRobot/modules/shout.py +++ b/SaitamaRobot/modules/shout.py @@ -19,24 +19,9 @@ def shout(update: Update, context: CallbackContext): return update.effective_message.reply_text(msg, parse_mode="MARKDOWN") -__help__ = """ - A little piece of fun wording! Give a loud shout out in the chatroom. - - i.e `/shout HELP`, bot replies with huge coded *HELP* letters within the square. - - • `/shout `*:* write anything you want to give loud shout. - ``` - t e s t - e e - s s - t t - ``` -""" - SHOUT_HANDLER = DisableAbleCommandHandler("shout", shout) dispatcher.add_handler(SHOUT_HANDLER) -__mod_name__ = "Shout" __command_list__ = ["shout"] __handlers__ = [SHOUT_HANDLER] diff --git a/SaitamaRobot/modules/ud.py b/SaitamaRobot/modules/ud.py index ca62d1b910..98bb690562 100644 --- a/SaitamaRobot/modules/ud.py +++ b/SaitamaRobot/modules/ud.py @@ -18,14 +18,9 @@ def ud(update: Update, context: CallbackContext): message.reply_text(reply_text, parse_mode=ParseMode.MARKDOWN) -__help__ = """ - • `/ud `*:* Type the word or expression you want to search use. -""" - UD_HANDLER = DisableAbleCommandHandler(["ud"], ud) dispatcher.add_handler(UD_HANDLER) -__mod_name__ = "Urban dictionary" __command_list__ = ["ud"] __handlers__ = [UD_HANDLER] diff --git a/SaitamaRobot/modules/userinfo.py b/SaitamaRobot/modules/userinfo.py index da12266876..42c8312086 100644 --- a/SaitamaRobot/modules/userinfo.py +++ b/SaitamaRobot/modules/userinfo.py @@ -144,10 +144,26 @@ def __user_info__(user_id): __help__ = """ - • `/setbio `*:* while replying, will save another user's bio - • `/bio`*:* will get your or another user's bio. This cannot be set by yourself. +*ID:* + • `/id`*:* get the current group id. If used by replying to a message, gets that user's id. + • `/gifid`*:* reply to a gif to me to tell you its file ID. + +*Self addded information:* • `/setme `*:* will set your info - • `/me`*:* will get your or another user's info + • `/me`*:* will get your or another user's info. +Examples: + `/setme I am a wolf.` + `/me @username(defaults to yours is no user specified)` + +*Information others add on you:* + • `/bio`*:* will get your or another user's bio. This cannot be set by yourself. +• `/setbio `*:* while replying, will save another user's bio +Examples: + `/bio @username(defaults to yours if not specified).` + `/setbio This user is a wolf` (reply to the user) + +*Overall Information about you:* + • `/info`*:* get information about a user. """ SET_BIO_HANDLER = DisableAbleCommandHandler("setbio", set_about_bio) @@ -161,7 +177,7 @@ def __user_info__(user_id): dispatcher.add_handler(SET_ABOUT_HANDLER) dispatcher.add_handler(GET_ABOUT_HANDLER) -__mod_name__ = "Bios and Abouts" +__mod_name__ = "Info" __command_list__ = ["setbio", "bio", "setme", "me"] __handlers__ = [ SET_BIO_HANDLER, GET_BIO_HANDLER, SET_ABOUT_HANDLER, GET_ABOUT_HANDLER diff --git a/SaitamaRobot/modules/users.py b/SaitamaRobot/modules/users.py index f06d6fd646..e26df5bdd1 100644 --- a/SaitamaRobot/modules/users.py +++ b/SaitamaRobot/modules/users.py @@ -54,9 +54,9 @@ def broadcast(update: Update, context: CallbackContext): if len(to_send) >= 2: to_group = to_user = False - if to_send[0] == '/broadcastgroup': + if to_send[0] == '/broadcastgroups': to_group = True - if to_send[0] == '/broadcastuser': + if to_send[0] == '/broadcastusers': to_user = True else: to_group = to_user = True @@ -159,7 +159,7 @@ def __migrate__(old_chat_id, new_chat_id): __help__ = "" # no help string BROADCAST_HANDLER = CommandHandler( - ["broadcastall", "broadcastuser", "broadcastgroup"], broadcast) + ["broadcastall", "broadcastusers", "broadcastgroups"], broadcast) USER_HANDLER = MessageHandler(Filters.all & Filters.group, log_user) CHAT_CHECKER_HANDLER = MessageHandler(Filters.all & Filters.group, chat_checker) CHATLIST_HANDLER = CommandHandler("chatlist", chats) diff --git a/SaitamaRobot/modules/weebify.py b/SaitamaRobot/modules/weebify.py index 547a87acb6..35446fb145 100644 --- a/SaitamaRobot/modules/weebify.py +++ b/SaitamaRobot/modules/weebify.py @@ -41,14 +41,9 @@ def weebify(update: Update, context: CallbackContext): message.reply_text(string) -__help__ = """ - • `/weebify `*:* returns a weebified text - """ - WEEBIFY_HANDLER = DisableAbleCommandHandler("weebify", weebify) dispatcher.add_handler(WEEBIFY_HANDLER) -__mod_name__ = "Weebify" __command_list__ = ["weebify"] __handlers__ = [WEEBIFY_HANDLER] diff --git a/SaitamaRobot/modules/wiki.py b/SaitamaRobot/modules/wiki.py index fcef87ab65..7a3f9e7c60 100644 --- a/SaitamaRobot/modules/wiki.py +++ b/SaitamaRobot/modules/wiki.py @@ -45,13 +45,5 @@ def wiki(update: Update, context: CallbackContext): disable_web_page_preview=True) -__help__ = """ -WIKIPEDIA!! -*Available commands:* - • `/wiki `*:* wiki your query. -""" - -__mod_name__ = "Wiki" - WIKI_HANDLER = DisableAbleCommandHandler("wiki", wiki) dispatcher.add_handler(WIKI_HANDLER) From ed601eb64ca8ff099919f8bbf39974bbfeece9b8 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 21:52:59 +0530 Subject: [PATCH 11/25] [misc] Help improvements --- SaitamaRobot/modules/misc.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/SaitamaRobot/modules/misc.py b/SaitamaRobot/modules/misc.py index ced25dfd9b..60751caba2 100644 --- a/SaitamaRobot/modules/misc.py +++ b/SaitamaRobot/modules/misc.py @@ -221,7 +221,7 @@ def stats(update: Update, context: CallbackContext): *Markdown:* • `/markdownhelp`*:* quick summary of how markdown works in telegram - can only be called in private chats *Paste:* - • `/paste`*:* Saves replied content to `neko.bin` and replies with a url + • `/paste`*:* Saves replied content to `nekobin.com` and replies with a url *React:* • `/react`*:* Reacts with a random reaction *Urban Dictonary:* @@ -231,13 +231,11 @@ def stats(update: Update, context: CallbackContext): *Currency converter:* • `/cash`*:* currency converter - Example: `/cash 1 USD INR` _OR_ `/cash 1 usd inr` - - Output: `1.0 USD = 75.505 INR` +Output: `1.0 USD = 75.505 INR` """ From 731bf6906ee2a4bc47236dc1f17cece0abb2bc5c Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 21:55:43 +0530 Subject: [PATCH 12/25] [userinfo] Minor corrections --- SaitamaRobot/modules/userinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SaitamaRobot/modules/userinfo.py b/SaitamaRobot/modules/userinfo.py index 42c8312086..f4b0b8097b 100644 --- a/SaitamaRobot/modules/userinfo.py +++ b/SaitamaRobot/modules/userinfo.py @@ -153,7 +153,7 @@ def __user_info__(user_id): • `/me`*:* will get your or another user's info. Examples: `/setme I am a wolf.` - `/me @username(defaults to yours is no user specified)` + `/me @username(defaults to yours if no user specified)` *Information others add on you:* • `/bio`*:* will get your or another user's bio. This cannot be set by yourself. From d601946f7fc360b663f7f9c51ba6fbfae5dd4075 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 21:58:01 +0530 Subject: [PATCH 13/25] Added extwaa !! for Disasters py --- SaitamaRobot/modules/disasters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SaitamaRobot/modules/disasters.py b/SaitamaRobot/modules/disasters.py index f0a56a2c12..cf7ef967f8 100644 --- a/SaitamaRobot/modules/disasters.py +++ b/SaitamaRobot/modules/disasters.py @@ -529,7 +529,7 @@ def devlist(update: Update, context: CallbackContext): __help__ = f""" -*⚠️ Notice:* +*⚠️ Notice:⚠️* Commands listed here only work for users with special access are mainly used for troubleshooting, debugging purposes. Group admins/group owners do not need these commands. From b1260613f7f1f52cc14b6fe83a9ee3d5bac10ec3 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 21:58:50 +0530 Subject: [PATCH 14/25] [misc] Minor edits to Extras help --- SaitamaRobot/modules/misc.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/SaitamaRobot/modules/misc.py b/SaitamaRobot/modules/misc.py index 60751caba2..c7a511be36 100644 --- a/SaitamaRobot/modules/misc.py +++ b/SaitamaRobot/modules/misc.py @@ -228,7 +228,6 @@ def stats(update: Update, context: CallbackContext): • `/ud `*:* Type the word or expression you want to search use *Wikipedia:* • `/wiki `*:* wikipedia your query - *Currency converter:* • `/cash`*:* currency converter Example: @@ -236,7 +235,6 @@ def stats(update: Update, context: CallbackContext): _OR_ `/cash 1 usd inr` Output: `1.0 USD = 75.505 INR` - """ ID_HANDLER = DisableAbleCommandHandler("id", get_id) From cfdbddeba7e82ce5d1e192255e1bcb83469dae25 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 22:12:17 +0530 Subject: [PATCH 15/25] Major help improvements to disasters, info, misc, anti-spam --- SaitamaRobot/modules/disasters.py | 28 +++++++++++++++++++- SaitamaRobot/modules/global_bans.py | 3 ++- SaitamaRobot/modules/remote_cmds.py | 40 +++++++++++++---------------- 3 files changed, 47 insertions(+), 24 deletions(-) diff --git a/SaitamaRobot/modules/disasters.py b/SaitamaRobot/modules/disasters.py index cf7ef967f8..a3bf1bd230 100644 --- a/SaitamaRobot/modules/disasters.py +++ b/SaitamaRobot/modules/disasters.py @@ -538,7 +538,7 @@ def devlist(update: Update, context: CallbackContext): • `/demons`*:* Lists all Demon disasters. • `/tigers`*:* Lists all Tigers disasters. • `/wolves`*:* Lists all Wolf disasters. - + *Ping:* • `/ping`*:* gets ping time of bot to telegram server • `/pingall`*:* gets all listed ping times @@ -556,6 +556,32 @@ def devlist(update: Update, context: CallbackContext): • `/ignore`*:* Blacklists a user from using the bot entirely. • `/notice`*:* Whitelists the user to allow bot usage. +*Speedtest:* + • `/speedtest`*:* Runs a speedtest and gives you 2 options to choose from, text or image output. + +*Global Bans:* + • `/gban user reason`*:* Globally bans a user anywhere the bot is admin in/will be admin in + • `/ungban user reason`*:* Unbans the user from the global bans list + +*Module loading:* + • `/listmodules`*:* Lists names of all modules + • `/load modulename`*:* Loads the said module to memory without restarting the bot + • `/unload modulename`*:* Loads the said module from memory without restarting the bot + +*Remote commands:* + • `/runban usernamne/id groupusername/id`*:* Remotely bans said user in said group + • `/rpunch usernamne/id groupusername/id`*:* Remotely punches said user from said group + • `/rmute usernamne/id groupusername/id`*:* Remotely mutes said user in said group + • `/runmute usernamne/id groupusername/id`*:* Remotely unmutes said user in said group + +*Shell commands:* + • `/eval`*:* Self explanatory + • `/py`*:* Self explanatory + +*Windows self hosted only:* + • `/restart`*:* Restarts the bots service. + • `/gitpull`*:* Pulls the repo and then restarts the bots service. + You can visit {SUPPORT_CHAT} if you want details on these. """ diff --git a/SaitamaRobot/modules/global_bans.py b/SaitamaRobot/modules/global_bans.py index addcadb1e8..4f8e701f2b 100644 --- a/SaitamaRobot/modules/global_bans.py +++ b/SaitamaRobot/modules/global_bans.py @@ -502,6 +502,7 @@ def __chat_settings__(chat_id, user_id): *What is SpamWatch?* SpamWatch maintains a large constantly updated ban-list of spambots, trolls, bitcoin spammers and unsavoury characters[.](https://telegra.ph/file/f584b643c6f4be0b1de53.jpg) Constantly help banning spammers off from your group automatically So, you wont have to worry about spammers storming your group. +*Note:* Users can appeal spamwatch bans or report spammers at @SpamwatchSupport """ GBAN_HANDLER = CommandHandler("gban", gban) @@ -517,7 +518,7 @@ def __chat_settings__(chat_id, user_id): dispatcher.add_handler(GBAN_LIST) dispatcher.add_handler(GBAN_STATUS) -__mod_name__ = "Global Bans" +__mod_name__ = "Anti-Spam" __handlers__ = [GBAN_HANDLER, UNGBAN_HANDLER, GBAN_LIST, GBAN_STATUS] if STRICT_GBAN: # enforce GBANS if this is set diff --git a/SaitamaRobot/modules/remote_cmds.py b/SaitamaRobot/modules/remote_cmds.py index 9a917a3468..4ec951c1bb 100644 --- a/SaitamaRobot/modules/remote_cmds.py +++ b/SaitamaRobot/modules/remote_cmds.py @@ -11,9 +11,9 @@ "User is an administrator of the chat", "Chat not found", "Not enough rights to restrict/unrestrict chat member", "User_not_participant", "Peer_id_invalid", "Group chat was deactivated", - "Need to be inviter of a user to kick it from a basic group", + "Need to be inviter of a user to punch it from a basic group", "Chat_admin_required", - "Only the creator of a basic group can kick group administrators", + "Only the creator of a basic group can punch group administrators", "Channel_private", "Not in the chat" } @@ -21,9 +21,9 @@ "User is an administrator of the chat", "Chat not found", "Not enough rights to restrict/unrestrict chat member", "User_not_participant", "Peer_id_invalid", "Group chat was deactivated", - "Need to be inviter of a user to kick it from a basic group", + "Need to be inviter of a user to punch it from a basic group", "Chat_admin_required", - "Only the creator of a basic group can kick group administrators", + "Only the creator of a basic group can punch group administrators", "Channel_private", "Not in the chat" } @@ -31,9 +31,9 @@ "User is an administrator of the chat", "Chat not found", "Not enough rights to restrict/unrestrict chat member", "User_not_participant", "Peer_id_invalid", "Group chat was deactivated", - "Need to be inviter of a user to kick it from a basic group", + "Need to be inviter of a user to punch it from a basic group", "Chat_admin_required", - "Only the creator of a basic group can kick group administrators", + "Only the creator of a basic group can punch group administrators", "Channel_private", "Not in the chat" } @@ -41,9 +41,9 @@ "User is an administrator of the chat", "Chat not found", "Not enough rights to restrict/unrestrict chat member", "User_not_participant", "Peer_id_invalid", "Group chat was deactivated", - "Need to be inviter of a user to kick it from a basic group", + "Need to be inviter of a user to punch it from a basic group", "Chat_admin_required", - "Only the creator of a basic group can kick group administrators", + "Only the creator of a basic group can punch group administrators", "Channel_private", "Not in the chat" } @@ -51,9 +51,9 @@ "User is an administrator of the chat", "Chat not found", "Not enough rights to restrict/unrestrict chat member", "User_not_participant", "Peer_id_invalid", "Group chat was deactivated", - "Need to be inviter of a user to kick it from a basic group", + "Need to be inviter of a user to punch it from a basic group", "Chat_admin_required", - "Only the creator of a basic group can kick group administrators", + "Only the creator of a basic group can punch group administrators", "Channel_private", "Not in the chat" } @@ -252,7 +252,7 @@ def rkick(update: Update, context: CallbackContext): if not is_bot_admin(chat, bot.id) or not chat.get_member( bot.id).can_restrict_members: message.reply_text( - "I can't restrict people there! Make sure I'm admin and can kick users." + "I can't restrict people there! Make sure I'm admin and can punch users." ) return @@ -266,27 +266,27 @@ def rkick(update: Update, context: CallbackContext): raise if is_user_ban_protected(chat, user_id, member): - message.reply_text("I really wish I could kick admins...") + message.reply_text("I really wish I could punch admins...") return if user_id == bot.id: - message.reply_text("I'm not gonna KICK myself, are you crazy?") + message.reply_text("I'm not gonna punch myself, are you crazy?") return try: chat.unban_member(user_id) - message.reply_text("Kicked from chat!") + message.reply_text("Punched from chat!") except BadRequest as excp: if excp.message == "Reply message not found": # Do not reply - message.reply_text('Kicked!', quote=False) + message.reply_text('Punched!', quote=False) elif excp.message in RKICK_ERRORS: message.reply_text(excp.message) else: LOGGER.warning(update) - LOGGER.exception("ERROR kicking user %s in chat %s (%s) due to %s", + LOGGER.exception("ERROR punching user %s in chat %s (%s) due to %s", user_id, chat.title, chat.id, excp.message) - message.reply_text("Well damn, I can't kick that user.") + message.reply_text("Well damn, I can't punch that user.") @run_async @@ -455,15 +455,11 @@ def runmute(update: Update, context: CallbackContext): message.reply_text("Well damn, I can't unmute that user.") -__help__ = "" - -__mod_name__ = "Remote Commands" - RBAN_HANDLER = CommandHandler("rban", rban, filters=CustomFilters.sudo_filter) RUNBAN_HANDLER = CommandHandler( "runban", runban, filters=CustomFilters.sudo_filter) RKICK_HANDLER = CommandHandler( - "rkick", rkick, filters=CustomFilters.sudo_filter) + "rpunch", rkick, filters=CustomFilters.sudo_filter) RMUTE_HANDLER = CommandHandler( "rmute", rmute, filters=CustomFilters.sudo_filter) RUNMUTE_HANDLER = CommandHandler( From d84a987f21e81bda2c70cedac278c8fa1c5b1ccd Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 22:20:33 +0530 Subject: [PATCH 16/25] [disasters] Attempt to improve the help UI further --- SaitamaRobot/modules/disasters.py | 93 ++++++++++++++++--------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/SaitamaRobot/modules/disasters.py b/SaitamaRobot/modules/disasters.py index a3bf1bd230..ff49178628 100644 --- a/SaitamaRobot/modules/disasters.py +++ b/SaitamaRobot/modules/disasters.py @@ -529,58 +529,59 @@ def devlist(update: Update, context: CallbackContext): __help__ = f""" -*⚠️ Notice:⚠️* +*⚠️ Notice:* Commands listed here only work for users with special access are mainly used for troubleshooting, debugging purposes. Group admins/group owners do not need these commands. - • `/heroes`*:* Lists all Hero Association members. - • `/dragons`*:* Lists all Dragon disasters. - • `/demons`*:* Lists all Demon disasters. - • `/tigers`*:* Lists all Tigers disasters. - • `/wolves`*:* Lists all Wolf disasters. +*• List all special users:* + ╔ `/heroes`*:* Lists all Hero Association members. + ╠ `/dragons`*:* Lists all Dragon disasters. + ╠ `/demons`*:* Lists all Demon disasters. + ╠ `/tigers`*:* Lists all Tigers disasters. + ╚ `/wolves`*:* Lists all Wolf disasters. -*Ping:* - • `/ping`*:* gets ping time of bot to telegram server - • `/pingall`*:* gets all listed ping times +*• Ping:* + ╔ `/ping`*:* gets ping time of bot to telegram server + ╚ `/pingall`*:* gets all listed ping times -*Broadcast: (Bot owner only)* +*• Broadcast: (Bot owner only)* Note: This supports basic markdown - • `/broadcastall messagehere`*:* Broadcasts the message everywhere. - • `/broadcastusers messagehere`*:* Broadcasts the message too all users of the bot. - • `/broadcastgroups messagehere`*:* Broadcasts the message too all groups of the bot. - -*Getchats:* - • `/getchats ID`*:* Gets a list of group names the user has been seen in. Bot owner only. - -*Blacklist:* - • `/ignore`*:* Blacklists a user from using the bot entirely. - • `/notice`*:* Whitelists the user to allow bot usage. - -*Speedtest:* - • `/speedtest`*:* Runs a speedtest and gives you 2 options to choose from, text or image output. - -*Global Bans:* - • `/gban user reason`*:* Globally bans a user anywhere the bot is admin in/will be admin in - • `/ungban user reason`*:* Unbans the user from the global bans list - -*Module loading:* - • `/listmodules`*:* Lists names of all modules - • `/load modulename`*:* Loads the said module to memory without restarting the bot - • `/unload modulename`*:* Loads the said module from memory without restarting the bot - -*Remote commands:* - • `/runban usernamne/id groupusername/id`*:* Remotely bans said user in said group - • `/rpunch usernamne/id groupusername/id`*:* Remotely punches said user from said group - • `/rmute usernamne/id groupusername/id`*:* Remotely mutes said user in said group - • `/runmute usernamne/id groupusername/id`*:* Remotely unmutes said user in said group - -*Shell commands:* - • `/eval`*:* Self explanatory - • `/py`*:* Self explanatory - -*Windows self hosted only:* - • `/restart`*:* Restarts the bots service. - • `/gitpull`*:* Pulls the repo and then restarts the bots service. + ╔ `/broadcastall messagehere`*:* Broadcasts the message everywhere. + ╠ `/broadcastusers messagehere`*:* Broadcasts the message too all users of the bot. + ╚ `/broadcastgroups messagehere`*:* Broadcasts the message too all groups of the bot. + +*• Getchats:* + ╚ `/getchats ID`*:* Gets a list of group names the user has been seen in. Bot owner only. + +*• Blacklist:* + ╔ `/ignore`*:* Blacklists a user from using the bot entirely. + ╚ `/notice`*:* Whitelists the user to allow bot usage. + +*• Speedtest:* + ╚ `/speedtest`*:* Runs a speedtest and gives you 2 options to choose from, text or image output. + +*• Global Bans:* + ╔ `/gban user reason`*:* Globally bans a user anywhere the bot is admin in/will be admin in + ╚ `/ungban user reason`*:* Unbans the user from the global bans list + +*• Module loading:* + ╔ `/listmodules`*:* Lists names of all modules + ╠ `/load modulename`*:* Loads the said module to memory without restarting the bot + ╚ `/unload modulename`*:* Loads the said module from memory without restarting the bot + +*• Remote commands:* + ╔ `/runban usernamne/id groupusername/id`*:* Remotely bans said user in said group + ╠ `/rpunch usernamne/id groupusername/id`*:* Remotely punches said user from said group + ╠ `/rmute usernamne/id groupusername/id`*:* Remotely mutes said user in said group + ╚ `/runmute usernamne/id groupusername/id`*:* Remotely unmutes said user in said group + +*• Shell commands:* + ╔ `/eval`*:* Self explanatory + ╚ `/py`*:* Self explanatory + +*• Windows self hosted only:* + ╔ `/restart`*:* Restarts the bots service. + ╚ `/gitpull`*:* Pulls the repo and then restarts the bots service. You can visit {SUPPORT_CHAT} if you want details on these. """ From 51fa6d2edb6ce43b7108615fcf397b19f11bbf66 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 22:24:45 +0530 Subject: [PATCH 17/25] [disasters] Attempt to improve the help UI plus ultra --- SaitamaRobot/modules/disasters.py | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/SaitamaRobot/modules/disasters.py b/SaitamaRobot/modules/disasters.py index ff49178628..d6a821ba06 100644 --- a/SaitamaRobot/modules/disasters.py +++ b/SaitamaRobot/modules/disasters.py @@ -533,54 +533,54 @@ def devlist(update: Update, context: CallbackContext): Commands listed here only work for users with special access are mainly used for troubleshooting, debugging purposes. Group admins/group owners do not need these commands. -*• List all special users:* - ╔ `/heroes`*:* Lists all Hero Association members. + ╔ *List all special users:* + ╠ `/heroes`*:* Lists all Hero Association members. ╠ `/dragons`*:* Lists all Dragon disasters. ╠ `/demons`*:* Lists all Demon disasters. ╠ `/tigers`*:* Lists all Tigers disasters. ╚ `/wolves`*:* Lists all Wolf disasters. -*• Ping:* - ╔ `/ping`*:* gets ping time of bot to telegram server + ╔ *Ping:* + ╠ `/ping`*:* gets ping time of bot to telegram server ╚ `/pingall`*:* gets all listed ping times -*• Broadcast: (Bot owner only)* -Note: This supports basic markdown - ╔ `/broadcastall messagehere`*:* Broadcasts the message everywhere. + ╔ *Broadcast: (Bot owner only)* + ╠ Note: This supports basic markdown + ╠ `/broadcastall messagehere`*:* Broadcasts the message everywhere. ╠ `/broadcastusers messagehere`*:* Broadcasts the message too all users of the bot. ╚ `/broadcastgroups messagehere`*:* Broadcasts the message too all groups of the bot. -*• Getchats:* + ╔ *Getchats:* ╚ `/getchats ID`*:* Gets a list of group names the user has been seen in. Bot owner only. -*• Blacklist:* - ╔ `/ignore`*:* Blacklists a user from using the bot entirely. + ╔ *Blacklist:* + ╠ `/ignore`*:* Blacklists a user from using the bot entirely. ╚ `/notice`*:* Whitelists the user to allow bot usage. -*• Speedtest:* + ╔ *Speedtest:* ╚ `/speedtest`*:* Runs a speedtest and gives you 2 options to choose from, text or image output. -*• Global Bans:* - ╔ `/gban user reason`*:* Globally bans a user anywhere the bot is admin in/will be admin in + ╔ *Global Bans:* + ╠ `/gban user reason`*:* Globally bans a user anywhere the bot is admin in/will be admin in ╚ `/ungban user reason`*:* Unbans the user from the global bans list -*• Module loading:* - ╔ `/listmodules`*:* Lists names of all modules + ╔ *Module loading:* + ╠ `/listmodules`*:* Lists names of all modules ╠ `/load modulename`*:* Loads the said module to memory without restarting the bot ╚ `/unload modulename`*:* Loads the said module from memory without restarting the bot -*• Remote commands:* - ╔ `/runban usernamne/id groupusername/id`*:* Remotely bans said user in said group + ╔ *Remote commands:* + ╠ `/runban usernamne/id groupusername/id`*:* Remotely bans said user in said group ╠ `/rpunch usernamne/id groupusername/id`*:* Remotely punches said user from said group ╠ `/rmute usernamne/id groupusername/id`*:* Remotely mutes said user in said group ╚ `/runmute usernamne/id groupusername/id`*:* Remotely unmutes said user in said group -*• Shell commands:* - ╔ `/eval`*:* Self explanatory + ╔ *Shell commands:* + ╠ `/eval`*:* Self explanatory ╚ `/py`*:* Self explanatory -*• Windows self hosted only:* - ╔ `/restart`*:* Restarts the bots service. + ╔ *Windows self hosted only:* + ╠ `/restart`*:* Restarts the bots service. ╚ `/gitpull`*:* Pulls the repo and then restarts the bots service. You can visit {SUPPORT_CHAT} if you want details on these. From 0c1a6558fb8eba2f245e3052b571db4bb7cc9250 Mon Sep 17 00:00:00 2001 From: Sawada Tsunayoshi Date: Fri, 28 Aug 2020 22:31:39 +0530 Subject: [PATCH 18/25] Adjustments to disasters help for OCD ridden users --- SaitamaRobot/modules/disasters.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/SaitamaRobot/modules/disasters.py b/SaitamaRobot/modules/disasters.py index d6a821ba06..25cb282537 100644 --- a/SaitamaRobot/modules/disasters.py +++ b/SaitamaRobot/modules/disasters.py @@ -534,46 +534,49 @@ def devlist(update: Update, context: CallbackContext): Group admins/group owners do not need these commands. ╔ *List all special users:* - ╠ `/heroes`*:* Lists all Hero Association members. ╠ `/dragons`*:* Lists all Dragon disasters. ╠ `/demons`*:* Lists all Demon disasters. ╠ `/tigers`*:* Lists all Tigers disasters. - ╚ `/wolves`*:* Lists all Wolf disasters. + ╠ `/wolves`*:* Lists all Wolf disasters. + ╚ `/heroes`*:* Lists all Hero Association members. ╔ *Ping:* ╠ `/ping`*:* gets ping time of bot to telegram server ╚ `/pingall`*:* gets all listed ping times ╔ *Broadcast: (Bot owner only)* - ╠ Note: This supports basic markdown - ╠ `/broadcastall messagehere`*:* Broadcasts the message everywhere. - ╠ `/broadcastusers messagehere`*:* Broadcasts the message too all users of the bot. - ╚ `/broadcastgroups messagehere`*:* Broadcasts the message too all groups of the bot. + ╠ *Note:* This supports basic markdown + ╠ `/broadcastall`*:* Broadcasts everywhere + ╠ `/broadcastusers`*:* Broadcasts too all users + ╚ `/broadcastgroups`*:* Broadcasts too all groups ╔ *Getchats:* ╚ `/getchats ID`*:* Gets a list of group names the user has been seen in. Bot owner only. ╔ *Blacklist:* - ╠ `/ignore`*:* Blacklists a user from using the bot entirely. + ╠ `/ignore`*:* Blacklists a user from + ╠ using the bot entirely. ╚ `/notice`*:* Whitelists the user to allow bot usage. ╔ *Speedtest:* ╚ `/speedtest`*:* Runs a speedtest and gives you 2 options to choose from, text or image output. ╔ *Global Bans:* - ╠ `/gban user reason`*:* Globally bans a user anywhere the bot is admin in/will be admin in + ╠ `/gban user reason`*:* Globally bans a user. ╚ `/ungban user reason`*:* Unbans the user from the global bans list ╔ *Module loading:* ╠ `/listmodules`*:* Lists names of all modules - ╠ `/load modulename`*:* Loads the said module to memory without restarting the bot - ╚ `/unload modulename`*:* Loads the said module from memory without restarting the bot + ╠ `/load modulename`*:* Loads the said module to + ╠ memory without restarting. + ╠ `/unload modulename`*:* Loads the said module from + ╚ memory without restarting.memory without restarting the bot ╔ *Remote commands:* - ╠ `/runban usernamne/id groupusername/id`*:* Remotely bans said user in said group - ╠ `/rpunch usernamne/id groupusername/id`*:* Remotely punches said user from said group - ╠ `/rmute usernamne/id groupusername/id`*:* Remotely mutes said user in said group - ╚ `/runmute usernamne/id groupusername/id`*:* Remotely unmutes said user in said group + ╠ `/runban user group`*:* + ╠ `/rpunch user group`*:* + ╠ `/rmute user group`*:* + ╚ `/runmute user group`*:* ╔ *Shell commands:* ╠ `/eval`*:* Self explanatory From e6c9f5cd5cbbdd7f2baf3f52f926bb7b95ee685d Mon Sep 17 00:00:00 2001 From: starry69 Date: Sat, 29 Aug 2020 10:04:28 +0530 Subject: [PATCH 19/25] Federations: Add /renamefed command Signed-off-by: starry69 --- SaitamaRobot/modules/feds.py | 28 +++++++++++++++++++++++++++- SaitamaRobot/modules/sql/feds_sql.py | 20 ++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/SaitamaRobot/modules/feds.py b/SaitamaRobot/modules/feds.py index 3b84759400..bdeffcf003 100644 --- a/SaitamaRobot/modules/feds.py +++ b/SaitamaRobot/modules/feds.py @@ -143,6 +143,29 @@ def del_fed(update: Update, context: CallbackContext): callback_data="rmfed_cancel")]])) + +@run_async +def rename_fed(update, context): + user = update.effective_user + msg = update.effective_message + args = msg.text.split(None, 2) + + if len(args) < 3: + return msg.reply_text("usage: /renamefed ") + + fed_id, newname = args[1], args[2] + verify_fed = sql.get_fed_info(fed_id) + + if not verify_fed: + return msg.reply_text("This fed not exist in my database!") + + if is_user_fed_owner(fed_id, user.id): + sql.rename_fed(fed_id, user.id, newname) + msg.reply_text(f"Successfully renamed your fed name to {newname}!") + else: + msg.reply_text("Only federation owner can do this!") + + @run_async def fed_chat(update: Update, context: CallbackContext): bot, args = context.bot, context.args @@ -2045,8 +2068,9 @@ def get_chat(chat_id, chat_data): def fed_owner_help(update: Update, context: CallbackContext): update.effective_message.reply_text( """*👑 Fed Owner Only:* - • `/newfed `*:* Creates a Federation, One allowed per user. Can also be used to rename the Fed. (max. 64 chars) + • `/newfed `*:* Creates a Federation with name given. (max. 64 chars) • `/delfed `*:* Delete a Federation, and any information related to it. Will not cancel blocked users. + • `/renamefed `*:* Renames your existing fed. • `/fpromote `*:* Assigns the user as a federation admin. Enables all commands for the user under `Fed Admins`. • `/fdemote `*:* Drops the User from the admin Federation to a normal User. • `/subfed `*:* Subscribes to a given fed ID, bans from that subscribed fed will also happen in your fed. @@ -2103,6 +2127,7 @@ def fed_user_help(update: Update, context: CallbackContext): NEW_FED_HANDLER = CommandHandler("newfed", new_fed) DEL_FED_HANDLER = CommandHandler("delfed", del_fed) +RENAME_FED = CommandHandler("renamefed", rename_fed) JOIN_FED_HANDLER = CommandHandler("joinfed", join_fed) LEAVE_FED_HANDLER = CommandHandler("leavefed", leave_fed) PROMOTE_FED_HANDLER = CommandHandler("fpromote", user_join_fed) @@ -2133,6 +2158,7 @@ def fed_user_help(update: Update, context: CallbackContext): dispatcher.add_handler(NEW_FED_HANDLER) dispatcher.add_handler(DEL_FED_HANDLER) +dispatcher.add_handler(RENAME_FED) dispatcher.add_handler(JOIN_FED_HANDLER) dispatcher.add_handler(LEAVE_FED_HANDLER) dispatcher.add_handler(PROMOTE_FED_HANDLER) diff --git a/SaitamaRobot/modules/sql/feds_sql.py b/SaitamaRobot/modules/sql/feds_sql.py index 7ee1e7347f..12b0cd2180 100644 --- a/SaitamaRobot/modules/sql/feds_sql.py +++ b/SaitamaRobot/modules/sql/feds_sql.py @@ -292,6 +292,26 @@ def del_fed(fed_id): return True +def rename_fed(fed_id, owner_id, newname): + with FEDS_LOCK: + global FEDERATION_BYFEDID, FEDERATION_BYOWNER, FEDERATION_BYNAME + fed = SESSION.query(Federations).get(fed_id) + if not fed: + return False + fed.fed_name = newname + SESSION.commit() + + # Update the dicts + oldname = FEDERATION_BYFEDID[str(fed_id)]["fname"] + tempdata = FEDERATION_BYNAME[oldname] + FEDERATION_BYNAME.pop(oldname) + + FEDERATION_BYOWNER[str(owner_id)]["fname"] = newname + FEDERATION_BYFEDID[str(fed_id)]["fname"] = newname + FEDERATION_BYNAME[newname] = tempdata + return True + + def chat_join_fed(fed_id, chat_name, chat_id): with FEDS_LOCK: global FEDERATION_CHATS, FEDERATION_CHATS_BYID From b0a166bf76401a3234179285254bb0ca6c904ae7 Mon Sep 17 00:00:00 2001 From: starry69 Date: Sat, 29 Aug 2020 10:35:30 +0530 Subject: [PATCH 20/25] Feds: fed_info: Don't append owner_id again since sql.all_fed_users already inclueds owner as well as admemes Signed-off-by: starry69 --- SaitamaRobot/modules/feds.py | 1 - 1 file changed, 1 deletion(-) diff --git a/SaitamaRobot/modules/feds.py b/SaitamaRobot/modules/feds.py index bdeffcf003..49955795e9 100644 --- a/SaitamaRobot/modules/feds.py +++ b/SaitamaRobot/modules/feds.py @@ -428,7 +428,6 @@ def fed_info(update: Update, context: CallbackContext): except: owner_name = owner.first_name FEDADMIN = sql.all_fed_users(fed_id) - FEDADMIN.append(int(owner.id)) TotalAdminFed = len(FEDADMIN) user = update.effective_user From 3a9c7e37eeb8c5ae902e13f622ecf7951ba224cf Mon Sep 17 00:00:00 2001 From: starry69 Date: Sat, 29 Aug 2020 14:57:30 +0530 Subject: [PATCH 21/25] Add spamwatch info in userinfo Signed-off-by: starry69 --- SaitamaRobot/modules/misc.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SaitamaRobot/modules/misc.py b/SaitamaRobot/modules/misc.py index c7a511be36..c48142773e 100644 --- a/SaitamaRobot/modules/misc.py +++ b/SaitamaRobot/modules/misc.py @@ -3,7 +3,7 @@ import requests from SaitamaRobot import (DEV_USERS, OWNER_ID, SUDO_USERS, SUPPORT_USERS, - TIGER_USERS, WHITELIST_USERS, dispatcher) + TIGER_USERS, WHITELIST_USERS, dispatcher, sw) from SaitamaRobot.__main__ import STATS, TOKEN, USER_INFO from SaitamaRobot.modules.disable import DisableAbleCommandHandler from SaitamaRobot.modules.helper_funcs.chat_status import sudo_plus, user_admin @@ -128,6 +128,17 @@ def info(update: Update, context: CallbackContext): text += f"\nPermanent user link: {mention_html(user.id, 'link')}" + try: + spamwtc = sw.get_ban(int(user.id)) + if spamwtc: + text += "\n\nThis person is banned in Spamwatch!" + text += f"\nReason:
{spamwtc.reason}
" + text += "\nAppeal at @SpamWatchSupport" + else: + pass + except: + pass # don't crash if api is down somehow... + disaster_level_present = False if user.id == OWNER_ID: From a909db6cd51b309a55c1d95a76d3ce718ce75c48 Mon Sep 17 00:00:00 2001 From: td Date: Sat, 29 Aug 2020 22:59:05 +0530 Subject: [PATCH 22/25] [locks] Make lock responses more sensible --- SaitamaRobot/modules/locks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SaitamaRobot/modules/locks.py b/SaitamaRobot/modules/locks.py index 1b2aa1788f..02fb1dd5d7 100644 --- a/SaitamaRobot/modules/locks.py +++ b/SaitamaRobot/modules/locks.py @@ -222,7 +222,7 @@ def lock(update, context) -> str: chat = dispatcher.bot.getChat(conn) chat_id = conn chat_name = chat.title - text = "Locked all {} messages for non-admins in {}!".format( + text = "Locked {} for non-admins in {}!".format( ltype, chat_name) else: if update.effective_message.chat.type == "private": @@ -234,7 +234,7 @@ def lock(update, context) -> str: chat = update.effective_chat chat_id = update.effective_chat.id chat_name = update.effective_message.chat.title - text = "Locked all {} messages for non-admins!".format( + text = "Locked {} for non-admins!".format( ltype) sql.update_lock(chat.id, ltype, locked=True) send_message( @@ -329,7 +329,7 @@ def unlock(update, context) -> str: chat = dispatcher.bot.getChat(conn) chat_id = conn chat_name = chat.title - text = "Unlocked {} messages for everyone in {}!".format( + text = "Unlocked {} for everyone in {}!".format( ltype, chat_name) else: if update.effective_message.chat.type == "private": @@ -341,7 +341,7 @@ def unlock(update, context) -> str: chat = update.effective_chat chat_id = update.effective_chat.id chat_name = update.effective_message.chat.title - text = "Unlocked {} messages for everyone!".format(ltype) + text = "Unlocked {} for everyone!".format(ltype) sql.update_lock(chat.id, ltype, locked=False) send_message( update.effective_message, text, parse_mode="markdown") From d4e4ccac0799dfda0622220890db4b779c1be3fa Mon Sep 17 00:00:00 2001 From: td Date: Sat, 29 Aug 2020 23:01:13 +0530 Subject: [PATCH 23/25] [misc] Add a line on disaster level in info --- SaitamaRobot/modules/misc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SaitamaRobot/modules/misc.py b/SaitamaRobot/modules/misc.py index c48142773e..d73f4bcd39 100644 --- a/SaitamaRobot/modules/misc.py +++ b/SaitamaRobot/modules/misc.py @@ -142,22 +142,22 @@ def info(update: Update, context: CallbackContext): disaster_level_present = False if user.id == OWNER_ID: - text += "\nThe Disaster level of this person is 'God'." + text += "\n\nThe Disaster level of this person is 'God'." disaster_level_present = True elif user.id in DEV_USERS: - text += "\nThis member is one of 'Hero Association'." + text += "\n\nThis member is one of 'Hero Association'." disaster_level_present = True elif user.id in SUDO_USERS: - text += "\nThe Disaster level of this person is 'Dragon'." + text += "\n\nThe Disaster level of this person is 'Dragon'." disaster_level_present = True elif user.id in SUPPORT_USERS: - text += "\nThe Disaster level of this person is 'Demon'." + text += "\n\nThe Disaster level of this person is 'Demon'." disaster_level_present = True elif user.id in TIGER_USERS: - text += "\nThe Disaster level of this person is 'Tiger'." + text += "\n\nThe Disaster level of this person is 'Tiger'." disaster_level_present = True elif user.id in WHITELIST_USERS: - text += "\nThe Disaster level of this person is 'Wolf'." + text += "\n\nThe Disaster level of this person is 'Wolf'." disaster_level_present = True if disaster_level_present: From 37f3c061fde01d2b73e80556b3f1a7ed2fefc1f0 Mon Sep 17 00:00:00 2001 From: TsunayoshiSawada Date: Sat, 29 Aug 2020 17:32:44 +0000 Subject: [PATCH 24/25] Automated code formatting. --- SaitamaRobot/modules/antiflood.py | 4 ++-- SaitamaRobot/modules/blacklistusers.py | 4 ++-- SaitamaRobot/modules/feds.py | 1 - SaitamaRobot/modules/gtranslator.py | 4 ++-- SaitamaRobot/modules/locks.py | 3 +-- SaitamaRobot/modules/misc.py | 16 ++++++++-------- SaitamaRobot/modules/reactions.py | 1 + 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/SaitamaRobot/modules/antiflood.py b/SaitamaRobot/modules/antiflood.py index 54dd6e0ff0..0a7110e3ac 100644 --- a/SaitamaRobot/modules/antiflood.py +++ b/SaitamaRobot/modules/antiflood.py @@ -73,8 +73,8 @@ def check_flood(update, context) -> str: permissions=ChatPermissions(can_send_messages=False)) execstrings = ("Muted for {}".format(getvalue)) tag = "TMUTE" - send_message( - update.effective_message,"Beep Boop! Boop Beep!\n{}!".format(execstrings)) + send_message(update.effective_message, + "Beep Boop! Boop Beep!\n{}!".format(execstrings)) return "{}:" \ "\n#{}" \ diff --git a/SaitamaRobot/modules/blacklistusers.py b/SaitamaRobot/modules/blacklistusers.py index 5f719c1410..501e22af5e 100644 --- a/SaitamaRobot/modules/blacklistusers.py +++ b/SaitamaRobot/modules/blacklistusers.py @@ -1,8 +1,8 @@ # Module to blacklist users and prevent them from using commands by @TheRealPhoenix import SaitamaRobot.modules.sql.blacklistusers_sql as sql -from SaitamaRobot import (DEV_USERS, OWNER_ID, SUDO_USERS, SUPPORT_USERS, TIGER_USERS, - WHITELIST_USERS, dispatcher) +from SaitamaRobot import (DEV_USERS, OWNER_ID, SUDO_USERS, SUPPORT_USERS, + TIGER_USERS, WHITELIST_USERS, dispatcher) from SaitamaRobot.modules.helper_funcs.chat_status import dev_plus from SaitamaRobot.modules.helper_funcs.extraction import (extract_user, extract_user_and_text) diff --git a/SaitamaRobot/modules/feds.py b/SaitamaRobot/modules/feds.py index 49955795e9..bfe466d5a6 100644 --- a/SaitamaRobot/modules/feds.py +++ b/SaitamaRobot/modules/feds.py @@ -143,7 +143,6 @@ def del_fed(update: Update, context: CallbackContext): callback_data="rmfed_cancel")]])) - @run_async def rename_fed(update, context): user = update.effective_user diff --git a/SaitamaRobot/modules/gtranslator.py b/SaitamaRobot/modules/gtranslator.py index a8614db783..6985b40631 100644 --- a/SaitamaRobot/modules/gtranslator.py +++ b/SaitamaRobot/modules/gtranslator.py @@ -17,9 +17,9 @@ def totranslate(update: Update, context: CallbackContext): if msg.reply_to_message: args = update.effective_message.text.split(None, 1) if msg.reply_to_message.text: - text = msg.reply_to_message.text + text = msg.reply_to_message.text elif msg.reply_to_message.caption: - text = msg.reply_to_message.caption + text = msg.reply_to_message.caption message = update.effective_message dest_lang = None diff --git a/SaitamaRobot/modules/locks.py b/SaitamaRobot/modules/locks.py index 02fb1dd5d7..9b3e152dff 100644 --- a/SaitamaRobot/modules/locks.py +++ b/SaitamaRobot/modules/locks.py @@ -234,8 +234,7 @@ def lock(update, context) -> str: chat = update.effective_chat chat_id = update.effective_chat.id chat_name = update.effective_message.chat.title - text = "Locked {} for non-admins!".format( - ltype) + text = "Locked {} for non-admins!".format(ltype) sql.update_lock(chat.id, ltype, locked=True) send_message( update.effective_message, text, parse_mode="markdown") diff --git a/SaitamaRobot/modules/misc.py b/SaitamaRobot/modules/misc.py index d73f4bcd39..5fffaee4ec 100644 --- a/SaitamaRobot/modules/misc.py +++ b/SaitamaRobot/modules/misc.py @@ -129,15 +129,15 @@ def info(update: Update, context: CallbackContext): text += f"\nPermanent user link: {mention_html(user.id, 'link')}" try: - spamwtc = sw.get_ban(int(user.id)) - if spamwtc: - text += "\n\nThis person is banned in Spamwatch!" - text += f"\nReason:
{spamwtc.reason}
" - text += "\nAppeal at @SpamWatchSupport" - else: - pass + spamwtc = sw.get_ban(int(user.id)) + if spamwtc: + text += "\n\nThis person is banned in Spamwatch!" + text += f"\nReason:
{spamwtc.reason}
" + text += "\nAppeal at @SpamWatchSupport" + else: + pass except: - pass # don't crash if api is down somehow... + pass # don't crash if api is down somehow... disaster_level_present = False diff --git a/SaitamaRobot/modules/reactions.py b/SaitamaRobot/modules/reactions.py index a4845d0480..396bb0cc6b 100644 --- a/SaitamaRobot/modules/reactions.py +++ b/SaitamaRobot/modules/reactions.py @@ -58,6 +58,7 @@ def react(update: Update, context: CallbackContext): else: message.reply_text(react) + REACT_HANDLER = DisableAbleCommandHandler("react", react) dispatcher.add_handler(REACT_HANDLER) From 504e4f485b293be77e53aed3c378e8fa7f3ab78f Mon Sep 17 00:00:00 2001 From: td Date: Sat, 29 Aug 2020 23:41:35 +0530 Subject: [PATCH 25/25] [feds] Update help and mention rename fed --- SaitamaRobot/modules/feds.py | 53 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/SaitamaRobot/modules/feds.py b/SaitamaRobot/modules/feds.py index 3b84759400..70f6eecc21 100644 --- a/SaitamaRobot/modules/feds.py +++ b/SaitamaRobot/modules/feds.py @@ -2045,16 +2045,17 @@ def get_chat(chat_id, chat_data): def fed_owner_help(update: Update, context: CallbackContext): update.effective_message.reply_text( """*👑 Fed Owner Only:* - • `/newfed `*:* Creates a Federation, One allowed per user. Can also be used to rename the Fed. (max. 64 chars) - • `/delfed `*:* Delete a Federation, and any information related to it. Will not cancel blocked users. - • `/fpromote `*:* Assigns the user as a federation admin. Enables all commands for the user under `Fed Admins`. - • `/fdemote `*:* Drops the User from the admin Federation to a normal User. - • `/subfed `*:* Subscribes to a given fed ID, bans from that subscribed fed will also happen in your fed. - • `/unsubfed `*:* Unsubscribes to a given fed ID. - • `/setfedlog `*:* Sets the group as a fed log report base for the federation. - • `/unsetfedlog `*:* Removed the group as a fed log report base for the federation. - • `/fbroadcast `*:* Broadcasts a messages to all groups that have joined your fed. - • `/fedsubs`*:* Shows the feds your group is subscribed to. `(broken rn)`""", + • `/newfed `*:* Creates a Federation, One allowed per user + • `/renamefed `*:* Renames the fed id to a new name + • `/delfed `*:* Delete a Federation, and any information related to it. Will not cancel blocked users + • `/fpromote `*:* Assigns the user as a federation admin. Enables all commands for the user under `Fed Admins` + • `/fdemote `*:* Drops the User from the admin Federation to a normal User + • `/subfed `*:* Subscribes to a given fed ID, bans from that subscribed fed will also happen in your fed + • `/unsubfed `*:* Unsubscribes to a given fed ID + • `/setfedlog `*:* Sets the group as a fed log report base for the federation + • `/unsetfedlog `*:* Removed the group as a fed log report base for the federation + • `/fbroadcast `*:* Broadcasts a messages to all groups that have joined your fed + • `/fedsubs`*:* Shows the feds your group is subscribed to `(broken rn)`""", parse_mode=ParseMode.MARKDOWN) @@ -2062,17 +2063,17 @@ def fed_owner_help(update: Update, context: CallbackContext): def fed_admin_help(update: Update, context: CallbackContext): update.effective_message.reply_text( """*🔱 Fed Admins:* - • `/fban `*:* Fed bans a user. - • `/unfban `*:* Removes a user from a fed ban. - • `/fedinfo `*:* Information about the specified Federation. - • `/joinfed `*:* Join the current chat to the Federation. Only chat owners can do this. Every chat can only be in one Federation. - • `/leavefed `*:* Leave the Federation given. Only chat owners can do this. - • `/setfrules `*:* Arrange Federation rules. - • `/fednotif `*:* Federation settings not in PM when there are users who are fbaned/unfbanned. - • `/frules`*:* See Federation regulations. - • `/fedadmins`*:* Show Federation admin. - • `/fbanlist`*:* Displays all users who are victimized at the Federation at this time. - • `/fedchats`*:* Get all the chats that are connected in the Federation.\n""", + • `/fban `*:* Fed bans a user + • `/unfban `*:* Removes a user from a fed ban + • `/fedinfo `*:* Information about the specified Federation + • `/joinfed `*:* Join the current chat to the Federation. Only chat owners can do this. Every chat can only be in one Federation + • `/leavefed `*:* Leave the Federation given. Only chat owners can do this + • `/setfrules `*:* Arrange Federation rules + • `/fednotif `*:* Federation settings not in PM when there are users who are fbaned/unfbanned + • `/frules`*:* See Federation regulations + • `/fedadmins`*:* Show Federation admin + • `/fbanlist`*:* Displays all users who are victimized at the Federation at this time + • `/fedchats`*:* Get all the chats that are connected in the Federation\n""", parse_mode=ParseMode.MARKDOWN) @@ -2080,8 +2081,8 @@ def fed_admin_help(update: Update, context: CallbackContext): def fed_user_help(update: Update, context: CallbackContext): update.effective_message.reply_text( """*🎩 Any user:* -• `/fbanstat`*:* Shows if you/or the user you are replying to or their username is fbanned somewhere or not. -• `/chatfed `*:* See the Federation in the current chat.\n""", +• `/fbanstat`*:* Shows if you/or the user you are replying to or their username is fbanned somewhere or not +• `/chatfed `*:* See the Federation in the current chat\n""", parse_mode=ParseMode.MARKDOWN) @@ -2095,9 +2096,9 @@ def fed_user_help(update: Update, context: CallbackContext): *Commands:*\n Feds are now divided into 3 sections for your ease. -• `/fedownerhelp`*:* Provides help for fed creation and owner only commands. -• `/fedadminhelp`*:* Provides help for fed administration commands. -• `/feduserhelp`*:* Provides help for commands anyone can use. +• `/fedownerhelp`*:* Provides help for fed creation and owner only commands +• `/fedadminhelp`*:* Provides help for fed administration commands +• `/feduserhelp`*:* Provides help for commands anyone can use """