Advertisement
iiFireKingii

Speed-test

Oct 16th, 2019
708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. const FastSpeedtest = require("fast-speedtest-api");
  2. let speedtest = new FastSpeedtest({
  3. token: "your-token",
  4. verbose: false,
  5. timeout: 10000,
  6. https: true,
  7. urlCount: 5,
  8. bufferSize: 8,
  9. unit: FastSpeedtest.UNITS.Mbps
  10. });
  11. client.on("message", async msg => {
  12. if(msg.author.bot) return undefined;
  13. if(msg.content.startsWith(prefix + "speed-test")) {
  14. let aas = await msg.channel.send(`please wait`);
  15. speedtest.getSpeed().then(s => {
  16. msg.channel.send(`**› Speed \`${s.toLocaleString()}\` Mbps**`)
  17. aas.delete().catch(a => {});
  18. }).catch(e => {
  19. console.error(e.message);
  20. msg.channel.send(`I find error`)
  21. });
  22. }
  23. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement