예제 #1
0
def set_user(bot: Bot, update: Update, args):
    msg = update.effective_message
    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!")
예제 #2
0
def set_user(update: Update, context: CallbackContext):
    args = context.args
    msg = update.effective_message
    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!")
예제 #3
0
def clear_user(update: Update, _):
    user = update.effective_user.id
    sql.set_user(user, "")
    update.effective_message.reply_text(
        "Last.fm username successfully cleared from my database!")