from discord.ext import commands
from BotResources import check_and_reply_to_ping


class ModuleProbe(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.channel_id = 767303243285790721

        self.add_events()

    def add_events(self):
        @self.bot.event
        async def on_message(message):
            await check_and_reply_to_ping(self.bot, message)

    @commands.command(help="This command is used by other bots to test if there are any bots online with modules.")
    async def check_modules(self, ctx):
        if ctx.author.id != self.bot.user.id:
            await ctx.send('pong')


def setup(bot: commands.Bot):
    bot.add_cog(ModuleProbe(bot))
