Added the info command

- Now you can't say that you don't know where is the source >:(
This commit is contained in:
0x5c 2019-10-04 08:53:05 -04:00
parent eaace87517
commit a66dcb64e2
No known key found for this signature in database
GPG Key ID: CCE14303E194D25E
2 changed files with 36 additions and 7 deletions

16
info.py
View File

@ -2,11 +2,19 @@
Static info about the bot.
---
`authors`: The authors of the bot.
`description`: A description of the bot.
`release_timestamp`: When the bot was last released.
`authors`: The authors of the bot.
`description`: A description of the bot.
`license`: The license the bot is released under.
`contrubuting`: Info on how to contribute to the bot.
`release_timestamp`: When the bot was last released.
"""
authors = ("@ClassAbbyAmplifier#2229", "@eyyyyyy#0006")
authors = ("@ClassAbbyAmplifier#2229", "@0x5c")
description = """A description goes here."""
license = "A license goes here."
contributing = "Info on contributing goes here."
release_timestamp = "not yet :P"

27
main.py
View File

@ -6,6 +6,8 @@ Qrm, a bot for Discord
[copyright here]
"""
from types import SimpleNamespace
import discord
import discord.ext.commands as commands
@ -14,11 +16,30 @@ import info
import options as opt
import keys
# --- Variables ---
debug_mode = opt.debug
bot = commands.Bot(command_prefix=opt.prefix, description=info.description)
# --- Global settings ---
debug_mode = opt.debug # Separate assignement in-case we define an override (ternary operator goes here)
bot_colours = SimpleNamespace(good=0x2dc614, neutral=0x2044f7, bad=0xc91628)
# --- Bot setup ---
bot = commands.Bot(command_prefix=opt.prefix, description=info.description, help_command=commands.MinimalHelpCommand())
# --- Commands ---
@bot.command(name="info", aliases=["about"])
async def _info(ctx):
"""Shows info about qrm."""
embed = discord.Embed(title="About qrm", description=info.description, colour=bot_colours.neutral)
embed = embed.add_field(name="Authors", value=", ".join(info.authors))
embed = embed.add_field(name="Contributing", value=info.contributing)
embed = embed.add_field(name="License", value=info.license)
await ctx.send(embed=embed)
try:
bot.run(keys.discord_token)