Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const FastSpeedtest = require("fast-speedtest-api");
- let speedtest = new FastSpeedtest({
- token: "your-token",
- verbose: false,
- timeout: 10000,
- https: true,
- urlCount: 5,
- bufferSize: 8,
- unit: FastSpeedtest.UNITS.Mbps
- });
- client.on("message", async msg => {
- if(msg.author.bot) return undefined;
- if(msg.content.startsWith(prefix + "speed-test")) {
- let aas = await msg.channel.send(`please wait`);
- speedtest.getSpeed().then(s => {
- msg.channel.send(`**› Speed \`${s.toLocaleString()}\` Mbps**`)
- aas.delete().catch(a => {});
- }).catch(e => {
- console.error(e.message);
- msg.channel.send(`I find error`)
- });
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement