sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

Dadjoke

Open Tr-Do opened this issue 4 months ago • 0 comments

Relevant Issues

https://github.com/python-discord/sir-lancebot/issues/1691?notification_referrer_id=NT_kwDOBivkC7UxODE0MTkwMjE5MjoxMDM1Mzk3MjM#event-19124053085

Description

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:

Tr-Do avatar Aug 13 '25 02:08 Tr-Do