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)
评论列表
文章目录