Moved the startup ping response to a module, so it will only reply if the modules are enabled

This commit is contained in:
Logan Cusano
2022-03-16 23:52:17 -04:00
parent db0922bf68
commit c564a145b5
4 changed files with 38 additions and 17 deletions

View File

@@ -191,3 +191,14 @@ def check_negative(s):
return False
except ValueError:
return False
# Check if message is a ping request and respond even if it is a bot
async def check_and_reply_to_ping(bot, message):
if "check_modules" in message.content:
ctx = await bot.get_context(message)
await bot.invoke(ctx)
return True
else:
await bot.process_commands(message)
return False