qrm2/cogs/funcog.py
Abigail Gold ad2c559a0f
Custom Help Command (#55)
* subclasses HelpCommand to implement a custom help command.

add cog names for display in the help command.

Globalsettings is no longer a cog. HelpCommand uses the custom attribute
category for grouping commands.

* PEP8 fixes

* improve variable names for help command clarity. Fixes #70

* improve help command formatting

add aliases for weather commands
add help text for ae7q call and qrz

* move global_settings to common

* rename import alias

* fix loading/unloading of help command

* fix info command

* fix options import

* changed canonical command names to be more descriptive

* remove cog names and revert map/bandplan error listing

* add link to hamstudy references
2019-12-06 01:19:42 -05:00

37 lines
1007 B
Python

"""
Fun cog for qrm
---
Copyright (C) 2019 Abigail Gold, 0x5c
This file is part of discord-qrmbot and is released under the terms of the GNU
General Public License, version 2.
"""
import discord.ext.commands as commands
import common as cmn
class FunCog(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name="xkcd", aliases=['x'], category=cmn.cat.fun)
async def _xkcd(self, ctx: commands.Context, number: str):
'''Look up an xkcd by number.'''
await ctx.send('http://xkcd.com/' + number)
@commands.command(name="tar", category=cmn.cat.fun)
async def _tar(self, ctx: commands.Context):
'''Returns an xkcd about tar.'''
await ctx.send('http://xkcd.com/1168')
@commands.command(name="xd", hidden=True, category=cmn.cat.fun)
async def _xd(self, ctx: commands.Context):
'''ecks dee'''
await ctx.send('ECKS DEE :smirk:')
def setup(bot: commands.Bot):
bot.add_cog(FunCog(bot))