Compare commits
2 Commits
snyk-upgra
...
feature/ch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2c954136d | ||
|
|
5820583609 |
2
.github/workflows/coverage.yml
vendored
2
.github/workflows/coverage.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Collect Code Coverage
|
- name: Collect Code Coverage
|
||||||
run: |
|
run: |
|
||||||
LINE_PCT=$(npm run test:coverage | tail -2 | head -1 | awk '{print $3}')
|
LINE_PCT=$(npm run coverage | tail -2 | head -1 | awk '{print $3}')
|
||||||
echo "COVERAGE=$LINE_PCT" >> $GITHUB_ENV
|
echo "COVERAGE=$LINE_PCT" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload Code Coverage
|
- name: Upload Code Coverage
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -47,4 +47,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Test Application
|
- name: Test Application
|
||||||
run: |
|
run: |
|
||||||
npm run test:run
|
npm run tests
|
||||||
|
|||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -10,7 +10,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^14.18.0",
|
"discord.js": "^14.18.0",
|
||||||
"dotenv": "^16.5.0",
|
"dotenv": "^16.4.7",
|
||||||
"ollama": "^0.5.14",
|
"ollama": "^0.5.14",
|
||||||
"redis": "^4.7.0"
|
"redis": "^4.7.0"
|
||||||
},
|
},
|
||||||
@@ -1595,9 +1595,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dotenv": {
|
"node_modules/dotenv": {
|
||||||
"version": "16.5.0",
|
"version": "16.4.7",
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
|
||||||
"integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==",
|
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
"main": "build/index.js",
|
"main": "build/index.js",
|
||||||
"exports": "./build/index.js",
|
"exports": "./build/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:run": "vitest run",
|
"tests": "vitest run",
|
||||||
"test:coverage": "vitest run --coverage",
|
"coverage": "vitest run --coverage",
|
||||||
"watch": "tsx watch src",
|
"watch": "tsx watch src",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"prod": "node .",
|
"prod": "node .",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^14.18.0",
|
"discord.js": "^14.18.0",
|
||||||
"dotenv": "^16.5.0",
|
"dotenv": "^16.4.7",
|
||||||
"ollama": "^0.5.14",
|
"ollama": "^0.5.14",
|
||||||
"redis": "^4.7.0"
|
"redis": "^4.7.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,12 +33,15 @@ const messageHistory: Queue<UserMessage> = new Queue<UserMessage>
|
|||||||
registerEvents(client, Events, messageHistory, ollama, Keys.defaultModel)
|
registerEvents(client, Events, messageHistory, ollama, Keys.defaultModel)
|
||||||
|
|
||||||
// Try to connect to redis
|
// Try to connect to redis
|
||||||
await redis.connect()
|
try {
|
||||||
.then(() => console.log('[Redis] Connected'))
|
await redis.connect()
|
||||||
.catch((error) => {
|
console.log('[Redis] Successfully Connected')
|
||||||
console.error('[Redis] Connection Error', error)
|
} catch(error) {
|
||||||
process.exit(1)
|
console.error('[Redis] Connection Error. See error below:\n', error)
|
||||||
})
|
console.warn('[Redis] Failed to connect to Redis Database, using local system')
|
||||||
|
// TODO: create boolean flag that will probably be used in messageCreate.ts if redis database is down
|
||||||
|
// When implementing this boolean flag, move connection to database BEFORE the registerEvents method
|
||||||
|
}
|
||||||
|
|
||||||
// Try to log in the client
|
// Try to log in the client
|
||||||
await client.login(Keys.clientToken)
|
await client.login(Keys.clientToken)
|
||||||
|
|||||||
Reference in New Issue
Block a user