[DadJokes] Initial commit
This commit is contained in:
@@ -13,6 +13,8 @@ cah - Cards Against Humanity, played in DM's. This can rate limit large bots via
|
||||
|
||||
chatchart - Generates a pie chart to display chat activity over the last 5000 messages. Requested by violetnyte.
|
||||
|
||||
dadjokes - Another UltimatePancake cog. Get some dad jokes on command.
|
||||
|
||||
dictonary - I stole this from UltimatePancake's v2 cogs, defines words via a dictonary. Only the "define" command for now until the dependency owner updates their files with a pending PR.
|
||||
|
||||
dungeon - New users with new accounts will be shuffled off to a locked channel on-join to help mitigate raiders. Please see the dungeon_readme.md file on this repo for more information.
|
||||
|
||||
5
dadjokes/__init__.py
Normal file
5
dadjokes/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from .dadjokes import DadJokes
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(DadJokes(bot))
|
||||
16
dadjokes/dadjokes.py
Normal file
16
dadjokes/dadjokes.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from redbot.core import commands
|
||||
import aiohttp
|
||||
|
||||
class DadJokes(commands.Cog):
|
||||
"""Random dad jokes from icanhazdadjoke.com"""
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@commands.command()
|
||||
async def dadjoke(self, ctx):
|
||||
"""Gets a random dad joke."""
|
||||
api = 'https://icanhazdadjoke.com/'
|
||||
async with aiohttp.request('GET', api, headers={'Accept': 'text/plain'}) as r:
|
||||
result = await r.text()
|
||||
await ctx.send(f"`{result}`")
|
||||
10
dadjokes/info.json
Normal file
10
dadjokes/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"author": [
|
||||
"UltimatePancake"
|
||||
],
|
||||
"description": "Gets a random dad joke from icanhazdadjoke.com",
|
||||
"install_msg": "Gets a random dad joke from icanhazdadjoke.com. Thanks for installing.",
|
||||
"short": "Random dad jokes",
|
||||
"tags": ["jokes", "dad", "dadjokes"],
|
||||
"type": "COG"
|
||||
}
|
||||
Reference in New Issue
Block a user