Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elif chat_message.body.lower().startswith("?ud "):
- try:
- UD_WORD = chat_message.body[3:].replace(' ', '+')
- url = f"https://urban-dictionary-api.0xn1nja.repl.co/api?word={UD_WORD}"
- response = requests.get(url).json()
- self.client.send_chat_message(chat_message.group_jid,
- "Word: " + str(
- response['word']) + '\n\n' + "Meaning : " + str(
- response['meaning']) + '\n\n' + "Example : " + str(
- response['example']))
- except:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement