generated from nhcarrigan/template
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
344d4d0de7 | |||
d3770103e1 |
34
.gitea/workflows/sonar.yml
Normal file
34
.gitea/workflows/sonar.yml
Normal file
@ -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=aria-iuvo
|
||||
|
||||
- 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"
|
@ -3,11 +3,14 @@
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import { i18n } from "./i18n.js";
|
||||
import type {
|
||||
ChatInputCommandInteraction,
|
||||
MessageContextMenuCommandInteraction,
|
||||
import {
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
type ChatInputCommandInteraction,
|
||||
type MessageContextMenuCommandInteraction,
|
||||
} from "discord.js";
|
||||
import { i18n } from "./i18n.js";
|
||||
|
||||
/**
|
||||
* Responds to an interaction with a generic error message.
|
||||
@ -20,9 +23,20 @@ export const replyToError = async(
|
||||
| MessageContextMenuCommandInteraction,
|
||||
locale: string,
|
||||
): Promise<void> => {
|
||||
const button = new ButtonBuilder().
|
||||
setLabel(i18n("button.support", locale)).
|
||||
setStyle(ButtonStyle.Link).
|
||||
setURL("https://chat.nhcarrigan.com");
|
||||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(button);
|
||||
if (interaction.deferred || interaction.replied) {
|
||||
await interaction.editReply(i18n("command-error", locale));
|
||||
await interaction.editReply({
|
||||
components: [ row ],
|
||||
content: i18n("command-error", locale),
|
||||
});
|
||||
return;
|
||||
}
|
||||
await interaction.reply(i18n("command-error", locale));
|
||||
await interaction.reply({
|
||||
components: [ row ],
|
||||
content: i18n("command-error", locale),
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user