from discord.ext import commands from nut_interface import NUT class Nut(commands.Cog): def __init__(self, bot): self.bot = bot self.nut = None @commands.Cog.listener() async def on_ready(self): logging.info("Nut cog ready") self.nut = NUT(login="admin", password="stereo") @commands.command(name="ping") async def ping(self, ctx): await ctx.send("pang") @commands.command(name="info") async def current_info(self, ctx): await ctx.send(self.nut.get_info()) async def setup(bot): await bot.add_cog(Nut(bot))