From 8739c04024b32db44821095949049a7c85b5559b Mon Sep 17 00:00:00 2001 From: Michael H Date: Sun, 13 May 2018 19:03:17 -0400 Subject: [PATCH] [V3] Ping changes (#1618) * moves ping to core commands defaults ping behavior to reacting with a ping pong paddle with ball adds an optional boolean flag to ping to get the avg latency from the bot (strikes a middle ground with intended behavior from dev standpoint, and how users want it) * casing for @Kowlin * use correct check for permissions * remove latency --- redbot/cogs/general/general.py | 5 ----- redbot/core/core_commands.py | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/redbot/cogs/general/general.py b/redbot/cogs/general/general.py index a4f01ce16..b1b262bce 100644 --- a/redbot/cogs/general/general.py +++ b/redbot/cogs/general/general.py @@ -49,11 +49,6 @@ class General: _("My sources say no"), _("Outlook not so good"), _("Very doubtful") ] - @commands.command(hidden=True) - async def ping(self, ctx): - """Pong.""" - await ctx.send("Pong.") - @commands.command() async def choose(self, ctx, *choices): """Chooses between multiple choices. diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index f84560798..2fb2a0fac 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -51,6 +51,14 @@ class Core: rpc.add_method('core', self.rpc_unload) rpc.add_method('core', self.rpc_reload) + @commands.command(hidden=True) + async def ping(self, ctx): + """Pong.""" + if ctx.guild is None or ctx.channel.permissions_for(ctx.guild.me).add_reactions: + await ctx.message.add_reaction("\U0001f3d3") # ping pong paddle + else: + await ctx.maybe_send_embed("Pong.") + @commands.command() async def info(self, ctx: commands.Context): """Shows info about Red"""