[DadJokes] Initial commit

This commit is contained in:
aikaterna
2019-10-08 17:37:09 -07:00
parent 632aceaf89
commit 8fc1ff176f
4 changed files with 33 additions and 0 deletions

View File

@@ -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
View File

@@ -0,0 +1,5 @@
from .dadjokes import DadJokes
def setup(bot):
bot.add_cog(DadJokes(bot))

16
dadjokes/dadjokes.py Normal file
View 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
View 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"
}