aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-20 16:35:11 +0300
committerGravatar ks129 <[email protected]>2020-05-20 16:35:11 +0300
commite2ce4ac6f372a92cc8c31c09237521e6b3aeb23b (patch)
tree6094cb1f1aa659cfb3e375bfacf7a0c5898c21ea
parentSource: Remove Cog check displaying from command (diff)
Source: Rename cog + move checks status from footer to field
- Renamed cog from `Source` to `BotSource` for itself (bot will be unable to get cog, because this always return command). - Moved checks status from footer to field and changed it's content.
-rw-r--r--bot/cogs/source.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/bot/cogs/source.py b/bot/cogs/source.py
index 220da535d..972507762 100644
--- a/bot/cogs/source.py
+++ b/bot/cogs/source.py
@@ -8,9 +8,6 @@ from discord.ext.commands import BadArgument, Cog, Command, Context, Converter,
from bot.bot import Bot
from bot.constants import URLs
-CANT_RUN_MESSAGE = "You can't run this command here."
-CAN_RUN_MESSAGE = "You are able to run this command."
-
class SourceConverter(Converter):
"""Convert argument to help command, command or Cog."""
@@ -39,7 +36,7 @@ class SourceConverter(Converter):
raise BadArgument(f"Unable to convert `{argument}` to valid command or Cog.")
-class Source(Cog):
+class BotSource(Cog):
"""Cog of Python Discord projects source information."""
def __init__(self, bot: Bot):
@@ -92,11 +89,11 @@ class Source(Cog):
embed.add_field(name="Source Code", value=f"[Go to GitHub]({link})")
if isinstance(source_object, Command):
- embed.set_footer(text=CAN_RUN_MESSAGE if await source_object.can_run(ctx) else CANT_RUN_MESSAGE)
+ embed.add_field(name="Can be used by you here?", value=await source_object.can_run(ctx))
return embed
def setup(bot: Bot) -> None:
"""Load `Source` cog."""
- bot.add_cog(Source(bot))
+ bot.add_cog(BotSource(bot))