Fix changes requested

This commit is contained in:
Ethan Lane 2022-09-04 16:38:15 +01:00
parent 508f8228b1
commit ae85233ae0
Signed by: Vylpes
GPG key ID: EED233CC06D12504
7 changed files with 23 additions and 35 deletions

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 @@
import { Entity, OneToMany } from "typeorm"; import { Entity, OneToMany } from "typeorm";
import BaseEntity from "../contracts/BaseEntity"; import BaseEntity from "../contracts/BaseEntity";
import Audit from "./Audit";
import Role from "./Role"; import Role from "./Role";
import Setting from "./Setting"; import Setting from "./Setting";