chupapee / telegram-stories-viewer-bot

🕵🏼‍♂️ View any Telegram stories anonymously (even protected ones). Just send a @username, phone number or direct link to the story!
https://t.me/tg_stories_downloader_bot
MIT License
25 stars 1 forks source link

Cannot run the bot locally #3

Closed Sinfolke closed 2 months ago

Sinfolke commented 2 months ago

I have tryed to run it locally but it requires some key that i do not have. I checked the telegram it did not send me any key.

C:\anonymous>yarn dev
yarn run v1.22.22
$ nodemon
[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src\**\*
[nodemon] watching extensions: ts,js
[nodemon] starting `node -r tsconfig-paths/register -r ts-node/register ./src/index.ts`
C:\anonymous\src\config\env-config.ts:7
    throw new Error(`Env variable ${key} is required`);
          ^
Error: Env variable NODE_ENV is required
    at getEnvVar (C:\anonymous\src\config\env-config.ts:7:11)
    at Object.<anonymous> (C:\anonymous\src\config\env-config.ts:13:34)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module.m._compile (C:\anonymous\node_modules\ts-node\src\index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Object.require.extensions.<computed> [as .ts] (C:\anonymous\node_modules\ts-node\src\index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
[nodemon] app crashed - waiting for file changes before starting...
chupapee commented 2 months ago

Just add "NODE_ENV=development" to .env file. In production mode it'll be automatically replaced to "NODE_ENV=production"

Sinfolke commented 2 months ago

Thank you, i found the env.example file in your project where there are such properties: DEV_BOT_TOKEN= PROD_BOT_TOKEN=

USERBOT_API_ID= USERBOT_API_HASH= USERBOT_PHONE_NUMBER=

BOT_ADMIN_ID= SUPABASE_PROJECT_URL= SUPABASE_API_KEY=

NODE_ENV=development

I have made .env file as above and get one more error. I guess i have to find somewhere values to all those properties

[nodemon] starting node -r tsconfig-paths/register -r ts-node/register ./src/index.ts { tasks: [] } C:\anonymous\node_modules\@supabase\supabase-js\src\SupabaseClient.ts:74 if (!supabaseUrl) throw new Error('supabaseUrl is required.') ^ Error: supabaseUrl is required. at new SupabaseClient (C:\anonymous\node_modules\@supabase\supabase-js\src\SupabaseClient.ts:74:29) at createClient (C:\anonymous\node_modules\@supabase\supabase-js\src\index.ts:40:10) at Object. (C:\anonymous\src\index.ts:14:37) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module.m._compile (C:\anonymous\node_modules\ts-node\src\index.ts:1618:23) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.require.extensions. [as .ts] (C:\anonymous\node_modules\ts-node\src\index.ts:1621:12) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) [nodemon] app crashed - waiting for file changes before starting...

chupapee commented 2 months ago

You can comment out the lines of code where supabase api is used: in config file, saveUser function definition and its usage, and the lines where supabase initiates But then, the users will not be stored in db

chupapee commented 2 months ago

Issue was closed due to inactivity. If the issue persists or requires further attention, feel free to reopen it or create a new one. Thank you!