teamspeak.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:teamSpeakTelegram 作者: jossalgon 项目源码 文件源码
def start(bot, update, args):
    message = update.message
    user = message.from_user
    res = False

    link = "http://www.teamspeak.com/invite/%s/" % TS_HOST
    reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton(_('Connect TS'), url=link)]])

    if args:
        res = utils.validate_invitation_token(token=args[0], user_id=user.id, name=user.first_name)

    if res:
        text = _("Welcome %s you're now activated, using /who or /ts you can check who's in teamspeak.") % \
               user.first_name
    elif utils.is_allow(user.id):
        text = _("Hello %s, using /who or /ts you can check who's in teamspeak.") % user.first_name
    else:
        reply_markup = None
        text = _("Welcome, ask admin to generate an invitation link by /generate")
    bot.sendMessage(message.chat_id, text, reply_to_message_id=message.message_id, reply_markup=reply_markup)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号