示例#1
0
文件: lastfm.py 项目: Phantom6h05T/X
def clear_user(update, context):
    user = update.effective_user.id
    sql.set_user(user, "")
    clear = update.effective_message.reply_text(
        "Last.fm username successfully cleared from my database!")
    time.sleep(10)
    clear.delete()
示例#2
0
文件: lastfm.py 项目: Phantom6h05T/X
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)
        del_msg = msg.reply_text(f"Username set as {username}!")

    else:
        del_msg = msg.reply_text(
            "That's not how this works...\nRun /setuser followed by your username!"
        )
    time.sleep(10)
    try:
        del_msg.delete()
    except error.BadRequest:
        return