kopia lustrzana https://github.com/J-Rios/TLG_JoinCaptchaBot
Notify connection commands can't be used in groups
rodzic
821a0d8161
commit
dc76dfefc8
|
|
@ -1477,6 +1477,14 @@ def cmd_connect(update: Update, context: CallbackContext):
|
|||
lang = lang.upper()
|
||||
# Ignore if command is not in private chat
|
||||
if chat_type != "private":
|
||||
# Ignore if not requested by a group Admin
|
||||
is_admin = tlg_user_is_admin(bot, user_id, chat_id)
|
||||
if (is_admin is None) or (is_admin == False):
|
||||
return
|
||||
# Send just allowed in private chat message
|
||||
lang = get_chat_config(chat_id, "Language")
|
||||
tlg_send_msg_type_chat(bot, chat_type, chat_id,
|
||||
TEXT[lang]["CMD_JUST_IN_PRIVATE"])
|
||||
return
|
||||
# Check for group chat ID
|
||||
if len(args) == 0:
|
||||
|
|
@ -1521,6 +1529,14 @@ def cmd_disconnect(update: Update, context: CallbackContext):
|
|||
lang = lang.upper()
|
||||
# Ignore if command is not in private chat
|
||||
if chat_type != "private":
|
||||
# Ignore if not requested by a group Admin
|
||||
is_admin = tlg_user_is_admin(bot, user_id, chat_id)
|
||||
if (is_admin is None) or (is_admin == False):
|
||||
return
|
||||
# Send just allowed in private chat message
|
||||
lang = get_chat_config(chat_id, "Language")
|
||||
tlg_send_msg_type_chat(bot, chat_type, chat_id,
|
||||
TEXT[lang]["CMD_JUST_IN_PRIVATE"])
|
||||
return
|
||||
# Check if User is connected to some group
|
||||
if user_id not in connections:
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Configuración del Grupo:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"Este comando no puede ser utilizado en un chat privado a menos que te conectes (/connect) a un grupo para configurarlo."
|
||||
"Este comando no puede ser utilizado en un chat privado a menos que te conectes (/connect) a un grupo para configurarlo.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"Este comando no puede usarse dentro de un grupo (utilízalo en chat privado con el Bot)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,5 +249,8 @@
|
|||
"Group Configuration:\n————————————————\n```\n{}\n```",
|
||||
|
||||
"CMD_NOT_ALLOW_PRIVATE":
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group."
|
||||
"This command cannot be used in private chat unless you make a connection (/connect) to configure some group.",
|
||||
|
||||
"CMD_JUST_IN_PRIVATE":
|
||||
"This command can't be used inside a group (use it in private Bot chat)."
|
||||
}
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue