From 551e858dcded9eefffe0d82e3931ef30075b5623 Mon Sep 17 00:00:00 2001 From: nex Date: Fri, 5 May 2023 00:11:29 +0100 Subject: [PATCH] fix info.py --- cogs/events.py | 2 +- cogs/info.py | 9 +++++---- setup.cfg | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cogs/events.py b/cogs/events.py index 753e87f..b7377fb 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -203,7 +203,7 @@ class Events(commands.Cog): @commands.Cog.listener() async def on_voice_state_update( - self, + self, member: discord.Member, *_ ): diff --git a/cogs/info.py b/cogs/info.py index d50bc8e..cbb7882 100644 --- a/cogs/info.py +++ b/cogs/info.py @@ -14,8 +14,8 @@ try: import fanshim import apa102 import RPi.GPIO as GPIO -except (ImportError, AttributeError): - fanshim = GPIO = None +except ImportError: + fanshim = GPIO = apa102 = None class InfoCog(commands.Cog): @@ -28,6 +28,7 @@ class InfoCog(commands.Cog): "SENSORS": "\N{thermometer}", "UPTIME": "\N{alarm clock}", } + def __init__(self, bot): self.bot = bot @@ -182,7 +183,7 @@ class InfoCog(commands.Cog): embed.add_field( name=f"{self.EMOJIS['NETWORK']} Network", value=f"**Sent:** {humanize.naturalsize(network.bytes_sent, binary=binary)}\n" - f"**Received:** {humanize.naturalsize(network.bytes_recv, binary=binary)}", + f"**Received:** {humanize.naturalsize(network.bytes_recv, binary=binary)}", inline=False, ) embed.add_field( @@ -196,4 +197,4 @@ class InfoCog(commands.Cog): def setup(bot): - bot.add_cog(InfoCog(bot)) \ No newline at end of file + bot.add_cog(InfoCog(bot)) diff --git a/setup.cfg b/setup.cfg index 3f936fc..ffb3a1a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,3 @@ [pycodestyle] max-line-length = 120 -ignore = W293 +ignore = W293,W291