mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
feat: first batch of emojis 🎉
This commit is contained in:
parent
dfb0e2c19d
commit
a4c4b17a14
91 changed files with 3659 additions and 2032 deletions
|
@ -0,0 +1,47 @@
|
|||
import { Attachment, ChatInputCommandInteraction, TextBasedChannel, User } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CaseTypes } from "../../../../data/CaseTypes";
|
||||
import { sendSuccessMessage } from "../../../../pluginUtils";
|
||||
import { UnknownUser, renderUserUsername } from "../../../../utils";
|
||||
import { CasesPlugin } from "../../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../../Logs/LogsPlugin";
|
||||
import { ModActionsPluginType } from "../../types";
|
||||
import { formatReasonWithAttachments } from "../formatReasonWithAttachments";
|
||||
|
||||
export async function actualNoteCmd(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
context: TextBasedChannel | ChatInputCommandInteraction,
|
||||
author: User,
|
||||
attachments: Array<Attachment>,
|
||||
user: User | UnknownUser,
|
||||
note: string,
|
||||
) {
|
||||
const userName = renderUserUsername(user);
|
||||
const reason = formatReasonWithAttachments(note, attachments);
|
||||
|
||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
const createdCase = await casesPlugin.createCase({
|
||||
userId: user.id,
|
||||
modId: author.id,
|
||||
type: CaseTypes.Note,
|
||||
reason,
|
||||
});
|
||||
|
||||
pluginData.getPlugin(LogsPlugin).logMemberNote({
|
||||
mod: author,
|
||||
user,
|
||||
caseNumber: createdCase.case_number,
|
||||
reason,
|
||||
});
|
||||
|
||||
sendSuccessMessage(
|
||||
pluginData,
|
||||
context,
|
||||
`Note added on **${userName}** (Case #${createdCase.case_number})`,
|
||||
undefined,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
|
||||
pluginData.state.events.emit("note", user.id, reason);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue