sir-lancebot
sir-lancebot copied to clipboard
Dadjoke
Relevant Issues
https://github.com/python-discord/sir-lancebot/issues/1691?notification_referrer_id=NT_kwDOBivkC7UxODE0MTkwMjE5MjoxMDM1Mzk3MjM#event-19124053085Description
Changes made:
- Extend the existing 'joke' command with 'dad' category using icanhazdadjoke API
- Keep the existing joke categories (chuck, neutral, all) How it's implemented:
- When dad joke is called, an asynchronous HTTP GET request is made to https://icanhazdadjoke.com with aiohttp
- Implement user agent to comply with icanhazdadjoke API policy
- The joke from JSON is sent back to the user with ctx.send()
- Linted and tested in a new python file before adding the code to fun.py
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the contributing guidelines?