advaith1 / activities

Discord slash command bot for opening voice channel activities, using Cloudflare Workers
https://get.activities.rocks
MIT License
607 stars 131 forks source link

ReferenceError: crypto is not defined #30

Closed NONPLAYT closed 2 years ago

NONPLAYT commented 2 years ago

When trying to start script, I get this:

var PUBLIC_KEY = crypto.subtle.importKey('raw', hex2bin('PUBLIC_KEY'), {
                 ^

ReferenceError: crypto is not defined
    at Object.<anonymous> (/home/pi/Desktop/GitHub/activities/src/verify.js:48:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/pi/Desktop/GitHub/activities/src/bot.js:40:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

What this and how fix this?

advaith1 commented 2 years ago

Activities is not a node app, it runs on Cloudflare Workers