Skip to content

Commit

Permalink
add .env file with all secret data
Browse files Browse the repository at this point in the history
  • Loading branch information
melod1n committed Aug 18, 2021
1 parent e7ed11b commit 6adcbe5
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,8 @@ typings/
*/*/*.map

data
data/answers.json
data/database.sql
data/settings.json
src/index.js
src/index.js.map
4 changes: 2 additions & 2 deletions data/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sendActionMessage": true,
"testAnswer": true,
"messagesReceived": 121,
"messagesSent": 53
"messagesReceived": 0,
"messagesSent": 0
}
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dependencies": {
"@types/node": "^14.14.31",
"@types/sqlite3": "^3.1.7",
"dotenv": "^10.0.0",
"sqlite3": "^5.0.2",
"systeminformation": "^5.6.1",
"tslint": "^6.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Help extends Command {
random_id: Utils.getRandomInt(10000)
}).catch((e) => {
error = e;
}).then((r) => {
}).then(() => {
if (error) {
Api.sendMessage(context, 'Не смог отправить команды в ЛС ☹');
return;
Expand Down
1 change: 0 additions & 1 deletion src/commands/system-specs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Command} from '../model/chat-command';
import * as SystemInformation from 'systeminformation';
import {Api} from '../api/api';
import {hardwareInfo} from '../index';

Expand Down
1 change: 0 additions & 1 deletion src/commands/who.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {Utils} from '../util/utils';
import {Api} from '../api/api';
import {whoAnswers} from '../database/settings-storage';
import {CacheStorage} from '../database/cache-storage';
import {Chat} from '../model/chat';

export class Who extends Command {
regexp = /^\/(who|кто)\s([^]+)/i;
Expand Down
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ import {Chat} from './model/chat';
import {CacheStorage} from './database/cache-storage';
import {LoadManager} from './api/load-manager';
import * as SystemInformation from 'systeminformation';
import * as dotenv from 'dotenv';

export const creatorId = 362877006;
dotenv.config();

export const creatorId = parseInt(process.env['CREATOR_ID']);
export const isDebug = true;
export let currentGroupId: number = -1;

Expand All @@ -54,7 +57,7 @@ setup();
let startMessage = !isDebug;

export let vk = new VK({
token: 'f2f16c92cd3c43b2b6cecc6bd2540437c4c21945d850439cb9b8f3630bc320fbaf32fb4fb6c7684c18c9a'
token: process.env['TOKEN']
});

globalThis.vk = vk;
Expand Down
4 changes: 3 additions & 1 deletion src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export class Utils {
});
}

static deepEqual(object1: { [x: string]: any }, object2: { [x: string]: any; year?: number; month?: number; day?: number }): boolean {
static deepEqual(object1: { [x: string]: any },
object2: { [x: string]: any; year?: number; month?: number; day?: number }
): boolean {
if ((object1 == null || object2 == null) && object1 != object2) return false;

const keys1 = Object.keys(object1);
Expand Down

0 comments on commit 6adcbe5

Please sign in to comment.