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:
Kumi 2024-06-16 08:33:50 +02:00
parent 79391d1cc5
commit 709144c339
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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