From 59e4d0522960cdd5501b5556ba5e9f48833f2833 Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Fri, 4 Oct 2019 20:19:31 -0400 Subject: [PATCH] [a very serious commit message] --- cogs/funcog.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ main.py | 1 + 2 files changed, 51 insertions(+) create mode 100644 cogs/funcog.py diff --git a/cogs/funcog.py b/cogs/funcog.py new file mode 100644 index 0000000..7e31282 --- /dev/null +++ b/cogs/funcog.py @@ -0,0 +1,50 @@ +""" +Fun cog for qrm +--- + +Copyright (C) 2019 Abigail Gold, 0x5c + +This file is part of discord-qrmbot. + +discord-qrmbot is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +""" + +import discord +import discord.ext.commands as commands + + +class FunCog(commands.Cog): + def __init__(self, bot): + self.bot = bot + self.gs = bot.get_cog("GlobalSettings") + + @commands.command(name="xkcd", aliases=['x']) + async def _xkcd(self, ctx, num : str): + '''Look up an xkcd by number.''' + await ctx.send('http://xkcd.com/' + num) + + @commands.command(name="tar") + async def _tar(self, ctx): + '''Returns an xkcd about tar.''' + await ctx.send('http://xkcd.com/1168') + + @commands.command(name="xd") + async def _xd(self, ctx): + '''ecks dee''' + await ctx.send('ECKS DEE :smirk:') + + +def setup(bot): + bot.add_cog(FunCog(bot)) diff --git a/main.py b/main.py index bda7ab3..fd27e2a 100644 --- a/main.py +++ b/main.py @@ -81,6 +81,7 @@ async def _before_ensure_activity(): bot.add_cog(GlobalSettings(bot)) bot.load_extension("cogs.basecog") +bot.load_extension("cogs.funcog") _ensure_activity.start()