def allow_connections(bot: Bot, update: Update, args: List[str]): chat = update.effective_chat if chat.type != chat.PRIVATE: if len(args) >= 1: var = args[0] if var == "no": sql.set_allow_connect_to_chat(chat.id, False) send_message(update.effective_message, "Connection has been disabled for this chat") elif var == "yes": sql.set_allow_connect_to_chat(chat.id, True) send_message(update.effective_message, "Connection has been enabled for this chat") else: send_message(update.effective_message, "Please enter `yes` or `no`!", parse_mode=ParseMode.MARKDOWN) else: get_settings = sql.allow_connect_to_chat(chat.id) if get_settings: send_message( update.effective_message, "Connections to this group are *Allowed* for members!", parse_mode=ParseMode.MARKDOWN) else: send_message( update.effective_message, "Connection to this group are *Not Allowed* for members!", parse_mode=ParseMode.MARKDOWN) else: send_message(update.effective_message, "This command is for group only. Not in PM!")
def allow_connections(bot: Bot, update: Update, args: List[str]): chat = update.effective_chat if chat.type != chat.PRIVATE: if len(args) >= 1: var = args[0] if var == "no": sql.set_allow_connect_to_chat(chat.id, False) send_message(update.effective_message, "Bağlantı Uğurla *KƏSİLDİ*") elif var == "yes": sql.set_allow_connect_to_chat(chat.id, True) send_message(update.effective_message, "Bağlantı Uğurlu olfu") else: send_message(update.effective_message, "Zəhmət olmasa `yes` və ya `no` yazın!", parse_mode=ParseMode.MARKDOWN) else: get_settings = sql.allow_connect_to_chat(chat.id) if get_settings: send_message(update.effective_message, "Bu qrupa qoşulma üzvlər üçün *İcazə verilir*!", parse_mode=ParseMode.MARKDOWN) else: send_message(update.effective_message, "Bu qrupa qoşulma üzvlər üçün *İcazə verilmir*!", parse_mode=ParseMode.MARKDOWN) else: send_message(update.effective_message, "Bu əmr yalnız qrup üçündür. PM-də deyil!")