Added embed generator for Counts, fixed projectKey for sonar
This commit is contained in:
parent
8454d3e189
commit
bf382d01ad
|
@ -56,7 +56,7 @@ jobs:
|
|||
args:
|
||||
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
|
||||
# mandatory
|
||||
-Dsonar.projectKey=The Artificer
|
||||
'-Dsonar.projectKey=The Artificer'
|
||||
-Dsonar.organization=milligan.dev
|
||||
# Comma-separated paths to directories containing main source files.
|
||||
#-Dsonar.sources= # optional, default is project base directory
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import config from "../config.ts";
|
||||
import { CountDetails } from "./solver/solver.d.ts";
|
||||
|
||||
const failColor = 0xe71212;
|
||||
const warnColor = 0xe38f28;
|
||||
|
@ -555,3 +556,37 @@ export const generateRollError = (errorType: string, errorMsg: string) => ({
|
|||
}]
|
||||
}]
|
||||
});
|
||||
|
||||
export const generateCountDetails = (counts: CountDetails) => ({
|
||||
embeds: [{
|
||||
color: infoColor1,
|
||||
title: "Roll Count Details:",
|
||||
fields: [
|
||||
{
|
||||
name: "Total Rolls:",
|
||||
details: `${counts.total}`,
|
||||
inline: true
|
||||
}, {
|
||||
name: "Successful Rolls:",
|
||||
details: `${counts.successful}`,
|
||||
inline: true
|
||||
}, {
|
||||
name: "Failed Rolls:",
|
||||
details: `${counts.failed}`,
|
||||
inline: true
|
||||
}, {
|
||||
name: "Rerolled Dice:",
|
||||
details: `${counts.rerolled}`,
|
||||
inline: true
|
||||
}, {
|
||||
name: "Dropped Dice:",
|
||||
details: `${counts.dropped}`,
|
||||
inline: true
|
||||
}, {
|
||||
name: "Exploded Dice:",
|
||||
details: `${counts.exploded}`,
|
||||
inline: true
|
||||
}
|
||||
]
|
||||
}]
|
||||
});
|
||||
|
|
|
@ -21,4 +21,4 @@ export type RollModifiers = {
|
|||
order: string,
|
||||
valid: boolean,
|
||||
count: boolean
|
||||
}
|
||||
};
|
||||
|
|
|
@ -38,3 +38,13 @@ export type SolvedRoll = {
|
|||
line2: string,
|
||||
line3: string
|
||||
};
|
||||
|
||||
// CountDetails is the object holding the count data for creating the Count Embed
|
||||
export type CountDetails = {
|
||||
total: number,
|
||||
successful: number,
|
||||
failed: number,
|
||||
rerolled: number,
|
||||
dropped: number,
|
||||
exploded: number
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue