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"))
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!" )
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"))
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!")