fix info.py

This commit is contained in:
Nexus 2023-05-05 00:11:29 +01:00
parent 7c791153f8
commit 551e858dcd
3 changed files with 7 additions and 6 deletions

View file

@ -203,7 +203,7 @@ class Events(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_voice_state_update( async def on_voice_state_update(
self, self,
member: discord.Member, member: discord.Member,
*_ *_
): ):

View file

@ -14,8 +14,8 @@ try:
import fanshim import fanshim
import apa102 import apa102
import RPi.GPIO as GPIO import RPi.GPIO as GPIO
except (ImportError, AttributeError): except ImportError:
fanshim = GPIO = None fanshim = GPIO = apa102 = None
class InfoCog(commands.Cog): class InfoCog(commands.Cog):
@ -28,6 +28,7 @@ class InfoCog(commands.Cog):
"SENSORS": "\N{thermometer}", "SENSORS": "\N{thermometer}",
"UPTIME": "\N{alarm clock}", "UPTIME": "\N{alarm clock}",
} }
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
@ -182,7 +183,7 @@ class InfoCog(commands.Cog):
embed.add_field( embed.add_field(
name=f"{self.EMOJIS['NETWORK']} Network", name=f"{self.EMOJIS['NETWORK']} Network",
value=f"**Sent:** {humanize.naturalsize(network.bytes_sent, binary=binary)}\n" 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, inline=False,
) )
embed.add_field( embed.add_field(
@ -196,4 +197,4 @@ class InfoCog(commands.Cog):
def setup(bot): def setup(bot):
bot.add_cog(InfoCog(bot)) bot.add_cog(InfoCog(bot))

View file

@ -1,3 +1,3 @@
[pycodestyle] [pycodestyle]
max-line-length = 120 max-line-length = 120
ignore = W293 ignore = W293,W291