feat: add feedback messages on feed removal
Enhances user experience by adding confirmation messages after removing a feed, whether by index or URL. This improvement helps users quickly verify that their intended action was successfully completed and mitigates confusion about the state of their feeds list.
This commit is contained in:
parent
79391d1cc5
commit
709144c339
1 changed files with 3 additions and 1 deletions
|
@ -13,13 +13,15 @@ async def command_removefeed(room: MatrixRoom, event: RoomMessageText, bot):
|
|||
|
||||
if identifier.isnumeric():
|
||||
try:
|
||||
feeds.pop(int(identifier))
|
||||
feed = feeds.pop(int(identifier))
|
||||
await bot.send_message(room, f"Feed with URL {feed} removed.", True)
|
||||
except IndexError:
|
||||
await bot.send_message(room, f"There is no feed with index {identifier}.")
|
||||
return
|
||||
else:
|
||||
try:
|
||||
feeds.remove(identifier)
|
||||
await bot.send_message(room, f"Feed with URL {identifier} removed.", True)
|
||||
except ValueError:
|
||||
await bot.send_message(room, "There is no bridged feed with the provided URL.")
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue