Currently, the /shownotifylist command does not inform the user if they don't have any playlists in their Notify list on the first try of a fresh start of the bot. Even if no playlists have been added, the code does not display any message indicating an empty list.
Expected Behavior
When a user does not have any playlists in their Notify list, the code should inform them with an appropriate message.
Actual Behavior
The code does not notify the user if they have an empty Notify list on the first try.
Steps to Reproduce
Run the bot for the first time without adding any playlists to the Notify list.
Observe that no message is displayed indicating an empty Notify list.
Code Snippet
class ShowNotifyListCommandHandler(BaseCommandHandler):
def specific_code(self, message, user_sp, chat_id, user_id):
conn = sqlite3.connect(database)
cursor = conn.cursor()
user_id_in_db = cursor.execute(
"SELECT user_id FROM notify_list WHERE user_id = ?", (user_id,)
).fetchone()
if user_id_in_db is None:
bot.send_message(
chat_id, "You don't have any playlists in your Notify list yet."
)
else:
user_playlists_name = cursor.execute(
"SELECT playlist_name FROM notify_list WHERE user_id = ?", (user_id,)
).fetchall()
user_playlists_name_arr = [result[0] for result in user_playlists_name]
notify_list = "\n- ".join(user_playlists_name_arr)
bot.send_message(
chat_id, f"This is your Notify list right now: \n\n- {notify_list}"
)
cursor.close()
conn.close()
Issue Description
Problem Statement
Currently, the
/shownotifylist
command does not inform the user if they don't have any playlists in their Notify list on the first try of a fresh start of the bot. Even if no playlists have been added, the code does not display any message indicating an empty list.Expected Behavior
When a user does not have any playlists in their Notify list, the code should inform them with an appropriate message.
Actual Behavior
The code does not notify the user if they have an empty Notify list on the first try.
Steps to Reproduce
Code Snippet