jamiew / helium-discord-bot

Helium hotspot stats & leaderboards for your Discord server
13 stars 3 forks source link

Hotspot activity command kills the process when no hotspot is provided #33

Open ch40s opened 2 years ago

ch40s commented 2 years ago

Hotspot activity command kills the process when no hotspot is provided.

Discord response:

Error: TypeError: Cannot read properties of undefined (reading 'trim') 
Make sure you use a valid hotspot ID, name-with-hyphens, or even 'name without hyphens'.

Server response:

  hotspot = hotspot.trim();
                    ^

TypeError: Cannot read properties of undefined (reading 'trim')
    at getAddressForHotspot (/helium-discord-bot/helium-api.js:194:21)
    at Object.getHotspotActivity (/helium-discord-bot/helium-api.js:184:25)
    at Client.<anonymous> (/helium-discord-bot/bot.js:104:36)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.