ch3p4ll3/QBittorrentBot

Stats error

reysonk opened this issue · 7 comments

Thank you for your wonderful bot, how to cure the problem?
when entering a command /stats, such an error occurs in the log

'coretemp'

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/pyrogram/dispatcher.py", line 242, in handler_worker

    await self.loop.run_in_executor(

  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run

    result = self.fn(*self.args, **self.kwargs)

  File "/app/src/bot.py", line 116, in stats_command

    f"**CPU температура:** {psutil.sensors_temperatures()['coretemp'][0].current}°C\n" \

KeyError: 'coretemp'

@reysonk Hi, what happens if you print psutil.sensors_temperatures()? Maybe you could have different sensor names

nothing happens

изображение

@reysonk sorry, maybe I explained myself wrong. You should open a python terminal, import psutils and then run the command

IMG_20230801_195655.jpg

sorry for quality.

@reysonk Ok, so, replace coretemp with k10temp and you'll be fine

tnx all works nice!

изображение

it's decided