Ejemplo n.º 1
0
def set_user(bot: Bot, update: Update, args):
    msg = update.effective_message
    chat = update.effective_chat
    if args:
        user = update.effective_user.id
        username = "******".join(args)
        sql.set_user(user, username)
        msg.reply_text(tld(chat.id, "misc_setuser_lastfm").format(username))
    else:
        msg.reply_text(tld(chat.id, "misc_setuser_lastfm_error"))
Ejemplo n.º 2
0
def set_user(update, context):
    msg = update.effective_message
    args = context.args
    if args:
        user = update.effective_user.id
        username = "******".join(args)
        sql.set_user(user, username)
        msg.reply_text(f"Username set as {username}!")
    else:
        msg.reply_text(
            "That's not how this works...\nRun /setuser followed by your username!"
        )
Ejemplo n.º 3
0
def clear_user(bot: Bot, update: Update):
    user = update.effective_user.id
    chat = update.effective_chat
    sql.set_user(user, "")
    update.effective_message.reply_text(tld(chat.id, "misc_clearuser_lastfm"))
Ejemplo n.º 4
0
def clear_user(update, context):
    user = update.effective_user.id
    sql.set_user(user, "")
    update.effective_message.reply_text(
        "Last.fm username successfully cleared from my database!")