Advertisement
Hey_Arnold

kik UD

Jul 29th, 2022
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1.         elif chat_message.body.lower().startswith("?ud "):
  2.             try:
  3.                 UD_WORD = chat_message.body[3:].replace(' ', '+')
  4.                 url = f"https://urban-dictionary-api.0xn1nja.repl.co/api?word={UD_WORD}"
  5.                 response = requests.get(url).json()
  6.                 self.client.send_chat_message(chat_message.group_jid,
  7.                                               "Word: " + str(
  8.                                                   response['word']) + '\n\n' + "Meaning : " + str(
  9.                                                   response['meaning']) + '\n\n' + "Example : " + str(
  10.                                                   response['example']))
  11.             except:
  12.                 pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement