qrm2/cogs/basecog.py
0x5c fb80caa5f6 [FIX] main.py: re-implemented shutdown and restart (#19)
- This time we actually use exit codes, and rely on a wrapper
  to restart
- Addition of said wrapper script (run.sh) (from 0x5c/quick-bot-no-pain)
- Moved both commands to main.py

Fixes #4
2019-10-06 22:42:44 -04:00

35 lines
1.1 KiB
Python

"""
Base 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
import discord.ext.commands as commands
class BaseCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.gs = bot.get_cog("GlobalSettings")
@commands.command(name="info", aliases=["about"])
async def _info(self, ctx):
"""Shows info about qrm."""
embed = discord.Embed(title="About qrm", description=self.gs.info.description, colour=self.gs.colours.neutral)
embed = embed.add_field(name="Authors", value=", ".join(self.gs.info.authors))
embed = embed.add_field(name="Contributing", value=self.gs.info.contributing)
embed = embed.add_field(name="License", value=self.gs.info.license)
await ctx.send(embed=embed)
@commands.command(name="ping")
async def _ping(self, ctx):
await ctx.send(f'**Pong!** Current ping is {self.bot.latency*1000:.1f} ms')
def setup(bot):
bot.add_cog(BaseCog(bot))