i can’t find a way to check a cogs command in discord python

I’ve been making a bot and I have separated some commands in cogs. but when it comes to a specific check I have trouble accessing the check on the main bot script. this is the check function in my main script:

    if str(ctx.channel.id) in getchannels(lnj_bot, ctx.message):
        return True
    elif () in getchannels(lnj_bot, ctx.message):
        return True
    else:
        return False

and this is my test cog:

    def __init__(self, lnj_bot):
        self.lnj_bot = lnj_bot
    @commands.command()
    async def test(self, ctx):
        with open("colors.json", "r") as test:
            test2 = json.load(test)
            await ctx.send(str(test2(2)))
def setup(lnj_bot):
    lnj_bot.add_cog(Test(lnj_bot))

is there a way to acces the check from the cog file?