Feature/vba 77 #178

Merged
Vylpes merged 13 commits from feature/VBA-77 into develop 2022-09-05 18:10:04 +01:00
7 changed files with 23 additions and 35 deletions
Showing only changes of commit ae85233ae0 - Show all commits

View file

@ -13,12 +13,13 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://gitea.vylpes.xyz/rabbitlabs/vylbot-app" "url": "https://github.com/Vylpes/vylbot-app"
}, },
"author": "Vylpes", "author": "Vylpes",
"license": "MIT", "license": "MIT",
"bugs": "https://gitea.vylpes.xyz/rabbitlabs/vylbot-app/issues", "bugs": "https://github.com/Vylpes/vylbot-app/issues",
"homepage": "https://gitea.vylpes.xyz/rabbitlabs/vylbot-app", "homepage": "https://github.com/Vylpes/vylbot-app",
"funding": "https://ko-fi.com/vylpes",
"dependencies": { "dependencies": {
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",

View file

@ -1,4 +1,4 @@
import { Emoji, MessageActionRow, MessageButton } from "discord.js"; import { MessageActionRow, MessageButton } from "discord.js";
import { MessageButtonStyles } from "discord.js/typings/enums"; import { MessageButtonStyles } from "discord.js/typings/enums";
import { ICommandContext } from "../contracts/ICommandContext"; import { ICommandContext } from "../contracts/ICommandContext";
import PublicEmbed from "../helpers/embeds/PublicEmbed"; import PublicEmbed from "../helpers/embeds/PublicEmbed";
@ -22,11 +22,19 @@ export default class About extends Command {
const row = new MessageActionRow(); const row = new MessageActionRow();
if (repoLink) { if (repoLink) {
row.addComponents(new MessageButton().setURL(repoLink).setLabel("Repo").setStyle(MessageButtonStyles.LINK)); row.addComponents(
new MessageButton()
.setURL(repoLink)
.setLabel("Repo")
.setStyle(MessageButtonStyles.LINK));
} }
if (fundingLink) { if (fundingLink) {
row.addComponents(new MessageButton().setURL(fundingLink).setLabel("Funding").setStyle(MessageButtonStyles.LINK)); row.addComponents(
new MessageButton()
.setURL(fundingLink)
.setLabel("Funding")
.setStyle(MessageButtonStyles.LINK));
} }
await embed.SendToCurrentChannel({ components: [row] }); await embed.SendToCurrentChannel({ components: [row] });

View file

@ -7,7 +7,6 @@ import { ICommandContext } from "../contracts/ICommandContext";
import ICommandReturnContext from "../contracts/ICommandReturnContext"; import ICommandReturnContext from "../contracts/ICommandReturnContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import { AuditType } from "../constants/AuditType"; import { AuditType } from "../constants/AuditType";
import Server from "../entity/Server";
export default class Ban extends Command { export default class Ban extends Command {
constructor() { constructor() {
@ -79,13 +78,9 @@ export default class Ban extends Command {
await publicEmbed.SendToCurrentChannel(); await publicEmbed.SendToCurrentChannel();
if (context.message.guild) { if (context.message.guild) {
const server = await Server.FetchOneById(Server, context.message.guild.id); const audit = new Audit(targetUser.id, AuditType.Ban, reason, context.message.author.id, context.message.guild.id);
if (server) { await audit.Save(Audit, audit);
const audit = new Audit(targetUser.id, AuditType.Ban, reason, context.message.author.id, context.message.guild.id);
await audit.Save(Audit, audit);
}
} }
return { return {

View file

@ -3,7 +3,6 @@ import ErrorMessages from "../constants/ErrorMessages";
import { ICommandContext } from "../contracts/ICommandContext"; import { ICommandContext } from "../contracts/ICommandContext";
import ICommandReturnContext from "../contracts/ICommandReturnContext"; import ICommandReturnContext from "../contracts/ICommandReturnContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import Server from "../entity/Server";
import ErrorEmbed from "../helpers/embeds/ErrorEmbed"; import ErrorEmbed from "../helpers/embeds/ErrorEmbed";
import LogEmbed from "../helpers/embeds/LogEmbed"; import LogEmbed from "../helpers/embeds/LogEmbed";
import PublicEmbed from "../helpers/embeds/PublicEmbed"; import PublicEmbed from "../helpers/embeds/PublicEmbed";
@ -79,13 +78,9 @@ export default class Kick extends Command {
await publicEmbed.SendToCurrentChannel(); await publicEmbed.SendToCurrentChannel();
if (context.message.guild) { if (context.message.guild) {
const server = await Server.FetchOneById(Server, context.message.guild.id); const audit = new Audit(targetUser.id, AuditType.Kick, reason, context.message.author.id, context.message.guild.id);
if (server) { await audit.Save(Audit, audit);
const audit = new Audit(targetUser.id, AuditType.Kick, reason, context.message.author.id, context.message.guild.id);
await audit.Save(Audit, audit);
}
} }
return { return {

View file

@ -3,7 +3,6 @@ import ErrorMessages from "../constants/ErrorMessages";
import { ICommandContext } from "../contracts/ICommandContext"; import { ICommandContext } from "../contracts/ICommandContext";
import ICommandReturnContext from "../contracts/ICommandReturnContext"; import ICommandReturnContext from "../contracts/ICommandReturnContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import Server from "../entity/Server";
import ErrorEmbed from "../helpers/embeds/ErrorEmbed"; import ErrorEmbed from "../helpers/embeds/ErrorEmbed";
import LogEmbed from "../helpers/embeds/LogEmbed"; import LogEmbed from "../helpers/embeds/LogEmbed";
import PublicEmbed from "../helpers/embeds/PublicEmbed"; import PublicEmbed from "../helpers/embeds/PublicEmbed";
@ -92,13 +91,9 @@ export default class Mute extends Command {
await publicEmbed.SendToCurrentChannel(); await publicEmbed.SendToCurrentChannel();
if (context.message.guild) { if (context.message.guild) {
const server = await Server.FetchOneById(Server, context.message.guild.id); const audit = new Audit(targetUser.id, AuditType.Mute, reason, context.message.author.id, context.message.guild.id);
if (server) { await audit.Save(Audit, audit);
const audit = new Audit(targetUser.id, AuditType.Mute, reason, context.message.author.id, context.message.guild.id);
await audit.Save(Audit, audit);
}
} }
return { return {

View file

@ -2,7 +2,6 @@ import { AuditType } from "../constants/AuditType";
import { ICommandContext } from "../contracts/ICommandContext"; import { ICommandContext } from "../contracts/ICommandContext";
import ICommandReturnContext from "../contracts/ICommandReturnContext"; import ICommandReturnContext from "../contracts/ICommandReturnContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import Server from "../entity/Server";
import ErrorEmbed from "../helpers/embeds/ErrorEmbed"; import ErrorEmbed from "../helpers/embeds/ErrorEmbed";
import LogEmbed from "../helpers/embeds/LogEmbed"; import LogEmbed from "../helpers/embeds/LogEmbed";
import PublicEmbed from "../helpers/embeds/PublicEmbed"; import PublicEmbed from "../helpers/embeds/PublicEmbed";
@ -67,13 +66,9 @@ export default class Warn extends Command {
await publicEmbed.SendToCurrentChannel(); await publicEmbed.SendToCurrentChannel();
if (context.message.guild) { if (context.message.guild) {
const server = await Server.FetchOneById(Server, context.message.guild.id); const audit = new Audit(user.id, AuditType.Warn, reason, context.message.author.id, context.message.guild.id);
if (server) { await audit.Save(Audit, audit);
const audit = new Audit(user.id, AuditType.Warn, reason, context.message.author.id, context.message.guild.id);
await audit.Save(Audit, audit);
}
} }
return { return {

View file

@ -1,6 +1,5 @@
VylpesTester commented 2022-08-20 21:01:38 +01:00 (Migrated from github.com)
Review

Unused import

Unused import
VylpesTester commented 2022-08-20 21:01:38 +01:00 (Migrated from github.com)
Review

Unused import

Unused import
import { Entity, OneToMany } from "typeorm"; import { Entity, OneToMany } from "typeorm";
import BaseEntity from "../contracts/BaseEntity"; import BaseEntity from "../contracts/BaseEntity";
import Audit from "./Audit";
VylpesTester commented 2022-08-20 21:01:38 +01:00 (Migrated from github.com)
Review

Unused import

Unused import
import Role from "./Role"; import Role from "./Role";
import Setting from "./Setting"; import Setting from "./Setting";

VylpesTester commented 2022-08-20 21:01:38 +01:00 (Migrated from github.com)
Review

Unused import

Unused import
VylpesTester commented 2022-08-20 21:01:38 +01:00 (Migrated from github.com)
Review

Unused import

Unused import