Advertisement
eartheekapat

message_react

Oct 15th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. token_list = ['abc123',]
  2. mesid_list = ['123', '132']
  3. reactid_list = ['13', '12']
  4. mesid_reactid_map = {'123' : '12', '132' : '13'}
  5.  
  6.  
  7. def message_react():
  8.     token = str(input('Token: '))
  9.     message_id = input('message id: ')
  10.     react_id = input('react id: ')
  11.  
  12.     #message_id is not a valid message within a channel that the authorised user has joined
  13.     if message_id not in mesid_list:
  14.         raise ValueError("Invalid message ID")
  15.     #react_id is not a valid React ID
  16.     if react_id not in reactid_list:
  17.         raise ValurError("Invalid react ID")
  18.     #Message with ID message_id already contains an active React with ID react_id
  19.     if react_id == mesid_reactid_map[message_id]:
  20.         raise ValueError("Message already contains an active react")
  21.  
  22.     return None
  23.  
  24. message_react()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement