generated from nhcarrigan/template
Compare commits
3 Commits
v1.0.0
...
a82122561a
| Author | SHA1 | Date | |
|---|---|---|---|
| a82122561a | |||
| dcb61d9c5b | |||
| 010967ef55 |
@@ -0,0 +1,34 @@
|
|||||||
|
name: Code Analysis
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sonar:
|
||||||
|
name: SonarQube
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source Files
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: SonarCube Scan
|
||||||
|
uses: SonarSource/sonarqube-scan-action@v4
|
||||||
|
timeout-minutes: 10
|
||||||
|
env:
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
SONAR_HOST_URL: "https://quality.nhcarrigan.com"
|
||||||
|
with:
|
||||||
|
args: >
|
||||||
|
-Dsonar.sources=.
|
||||||
|
-Dsonar.projectKey=becca-lyria
|
||||||
|
|
||||||
|
- name: SonarQube Quality Gate check
|
||||||
|
uses: sonarsource/sonarqube-quality-gate-action@v1
|
||||||
|
with:
|
||||||
|
pollingTimeoutSec: 600
|
||||||
|
env:
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
SONAR_HOST_URL: "https://quality.nhcarrigan.com"
|
||||||
@@ -4,7 +4,7 @@ Becca is a user-installable bot that allows you to play a text-based role-playin
|
|||||||
|
|
||||||
## Live Version
|
## Live Version
|
||||||
|
|
||||||
[Add her to your account](https://discord.com/oauth2/authorize?client_id=1338596130207957035)!
|
[Add her to your account](https://discord.com/oauth2/authorize?client_id=1343341112437248041)!
|
||||||
|
|
||||||
## Feedback and Bugs
|
## Feedback and Bugs
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -14,18 +14,18 @@
|
|||||||
"author": "Naomi Carrigan",
|
"author": "Naomi Carrigan",
|
||||||
"license": "See license in LICENSE.md",
|
"license": "See license in LICENSE.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nhcarrigan/eslint-config": "5.1.0",
|
"@nhcarrigan/eslint-config": "5.2.0",
|
||||||
"@nhcarrigan/typescript-config": "4.0.0",
|
"@nhcarrigan/typescript-config": "4.0.0",
|
||||||
"@types/node": "22.13.1",
|
"@types/node": "22.15.21",
|
||||||
"@vitest/coverage-istanbul": "3.0.5",
|
"@vitest/coverage-istanbul": "3.1.4",
|
||||||
"eslint": "9.20.0",
|
"eslint": "9.27.0",
|
||||||
"typescript": "5.7.3",
|
"typescript": "5.8.3",
|
||||||
"vitest": "3.0.5"
|
"vitest": "3.1.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/sdk": "0.36.3",
|
"@anthropic-ai/sdk": "0.52.0",
|
||||||
"@nhcarrigan/logger": "1.0.0",
|
"@nhcarrigan/logger": "1.0.0",
|
||||||
"discord.js": "14.18.0",
|
"discord.js": "14.19.3",
|
||||||
"fastify": "5.2.1"
|
"fastify": "5.3.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+330
-439
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ import {
|
|||||||
import { personality } from "../config/personality.js";
|
import { personality } from "../config/personality.js";
|
||||||
import { ai } from "../utils/ai.js";
|
import { ai } from "../utils/ai.js";
|
||||||
import { calculateCost } from "../utils/calculateCost.js";
|
import { calculateCost } from "../utils/calculateCost.js";
|
||||||
|
import { isSubscribedInteraction } from "../utils/isSubscribed.js";
|
||||||
import { logger } from "../utils/logger.js";
|
import { logger } from "../utils/logger.js";
|
||||||
import { replyToError } from "../utils/replyToError.js";
|
import { replyToError } from "../utils/replyToError.js";
|
||||||
|
|
||||||
@@ -24,13 +25,18 @@ export const start = async(
|
|||||||
try {
|
try {
|
||||||
await interaction.deferReply({ flags: [ MessageFlags.Ephemeral ] });
|
await interaction.deferReply({ flags: [ MessageFlags.Ephemeral ] });
|
||||||
|
|
||||||
|
const subbed = await isSubscribedInteraction(interaction);
|
||||||
|
if (!subbed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const messages = await ai.messages.create({
|
const messages = await ai.messages.create({
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Required key format for SDK.
|
// eslint-disable-next-line @typescript-eslint/naming-convention -- Required key format for SDK.
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
messages: [
|
messages: [
|
||||||
{ content: "Please start a new story for me.", role: "user" },
|
{ content: "Please start a new story for me.", role: "user" },
|
||||||
],
|
],
|
||||||
model: "claude-3-5-sonnet-latest",
|
model: "claude-sonnet-4-20250514",
|
||||||
system: `${personality} The user has requested to start a new adventure. You should generate the first message for the game. The user's name is ${interaction.user.displayName}`,
|
system: `${personality} The user has requested to start a new adventure. You should generate the first message for the game. The user's name is ${interaction.user.displayName}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user