viligen

chat_logger

Oct 25th, 2021
750
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. chat = []
  2. while True:
  3.     command = input().split()
  4.     if command[0] == "end":
  5.         break
  6.     elif "Chat" == command[0]:
  7.         chat.append(command[1])
  8.     elif command[0] == "Delete" and command[1] in chat:
  9.         chat.remove(command[1])
  10.     elif command[0] == "Edit" and command[1] in chat:
  11.         index_msg = chat.index(command[1])
  12.         chat[index_msg] = command[2]
  13.     elif command[0] == "Pin" and command[1] in chat:
  14.         chat.remove(command[1])
  15.         chat.append(command[1])
  16.     elif command[0] == "Spam":
  17.         messages = command[1:]
  18.         chat = chat + messages
  19.  
  20. print("\n".join(chat))
  21.  
RAW Paste Data