コード例 #1
0
ファイル: feds.py プロジェクト: shreyansh000/Userbot
def get_frules(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    fed_id = sql.get_fed_id(chat.id)
    rules = sql.get_frules(fed_id).rules
    print(rules)
    text = "*Rules in this fed:*\n"
    text += rules
    update.effective_message.reply_text(tld(chat.id, text),
                                        parse_mode=ParseMode.MARKDOWN)
コード例 #2
0
def get_frules(bot: Bot, update: Update, args: List[str]):
	chat = update.effective_chat  # type: Optional[Chat]
	fed_id = sql.get_fed_id(chat.id)
	if not fed_id:
		update.effective_message.reply_text("This chat is not in any federation!")
		return

	rules = sql.get_frules(fed_id)
	text = "*Rules in this fed:*\n"
	text += rules
	update.effective_message.reply_text(text, parse_mode=ParseMode.MARKDOWN)
コード例 #3
0
def get_frules(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    fed_id = sql.get_fed_id(chat.id)
    if not fed_id:
        update.effective_message.reply_text(tld(chat.id, "This chat is not in any federation!"))
        return

    ruless = sql.get_frules(fed_id)
    try:
        rules = ruless.rules
        print(rules)
        text = "*Rules in this fed:*\n"
        text += rules
        update.effective_message.reply_text(tld(chat.id, text), parse_mode=ParseMode.MARKDOWN)
        return
    except AttributeError:
        update.effective_message.reply_text(tld(chat.id, "There are no rules in this federation!"))
        return