Is there a native way to read CPU statistics from a repl?

Hi, I’m currently renovating a Discord bot (using discord.js, not sure what version number) that I haven’t updated in a long time, and I’m trying to see if I can find a way to natively read the CPU statistics from a repl. Is this at all possible, and if there isn’t a way to do it via repl itself, does anyone have any suggestions for packages that can be used to accomplish this?

Hey, @WHSBurner welcome to the forums!

Just to clarify, you want the program to read the CPU usage without needing a person to do it. Right?

Well, yes and no. I’m wanting to have it read and then shown to the user via a Discord message sent from the bot when executing a command.
Kind of like this:
User: &cpu (this would be the command sent by the user to find this information)
Bot: Current CPU usage is insert CPU usage percentage here out of insert maximum usage here

Unfortunately I don’t think this is possible because Replit discontinued their public API this month

Ah, that’s unfortunate. I’m doing some looking on some packages in npm that might help accomplish this, but thanks for your help!

1 Like