From e30a0c0e80451164202e2471d101b1b8aae88d30 Mon Sep 17 00:00:00 2001 From: Victor Batischev Date: Sun, 13 Aug 2023 17:24:50 +0300 Subject: [PATCH] add .gitignore and .env --- .gitignore | 130 ++++++++++++++++++++++++++++++++ TutorialBot.ts | 2 +- environment.d.ts | 13 ++++ node_modules/.package-lock.json | 11 +++ package-lock.json | 12 +++ package.json | 1 + 6 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 environment.d.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a7d6d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,130 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* \ No newline at end of file diff --git a/TutorialBot.ts b/TutorialBot.ts index cf1fc5d..79c33b9 100644 --- a/TutorialBot.ts +++ b/TutorialBot.ts @@ -5,7 +5,7 @@ import open from 'open' let screaming = false //Create a new bot -const bot = new Bot('6636973136:AAFls6Zf5ymvDcYoyGiDMvQmuEjoT5nlkHo') +const bot = new Bot(process.env.BOT_API_TOKEN) //This function handles the /scream command bot.command('scream', () => { diff --git a/environment.d.ts b/environment.d.ts new file mode 100644 index 0000000..9b49046 --- /dev/null +++ b/environment.d.ts @@ -0,0 +1,13 @@ +declare global { + namespace NodeJS { + interface ProcessEnv { + BOT_API_TOKEN: string + NODE_ENV: 'development' | 'production' + PORT?: string + } + } +} + +// If this file has no import/export statements (i.e. is a script) +// convert it into a module by adding an empty export statement. +export {} diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 74475a1..9e541fa 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -335,6 +335,17 @@ "node": ">=0.3.1" } }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, "node_modules/dynamic-dedupe": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz", diff --git a/package-lock.json b/package-lock.json index 1540c05..4221d21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "dotenv": "^16.3.1", "grammy": "^1.17.2", "open": "^9.1.0" }, @@ -350,6 +351,17 @@ "node": ">=0.3.1" } }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, "node_modules/dynamic-dedupe": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz", diff --git a/package.json b/package.json index f6ba9a4..0bcedec 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "license": "ISC", "type": "module", "dependencies": { + "dotenv": "^16.3.1", "grammy": "^1.17.2", "open": "^9.1.0" },