mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
some more patches thanks to ruby
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
ba4a2b45b8
commit
10bb0b67bc
18 changed files with 69 additions and 52 deletions
|
@ -1,7 +1,7 @@
|
|||
import { APIEmbed, User } from "discord.js";
|
||||
import { APIEmbed, GuildMember, User } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { emptyEmbedValue, resolveUser, trimLines } from "../../../utils";
|
||||
import { emptyEmbedValue, renderUsername, resolveMember, resolveUser, trimLines } from "../../../utils";
|
||||
import { asyncMap } from "../../../utils/async";
|
||||
import { createPaginatedMessage } from "../../../utils/createPaginatedMessage";
|
||||
import { getChunkedEmbedFields } from "../../../utils/getChunkedEmbedFields";
|
||||
|
@ -28,8 +28,10 @@ export const CasesModCmd = modActionsCmd({
|
|||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
const modId = args.mod || msg.author.id;
|
||||
const mod = await resolveUser(pluginData.client, modId);
|
||||
const modName = mod instanceof User ? mod.tag : modId;
|
||||
const mod =
|
||||
(await resolveMember(pluginData.client, pluginData.guild, modId)) ||
|
||||
(await resolveUser(pluginData.client, modId));
|
||||
const modName = mod instanceof User ? renderUsername(mod) : modId;
|
||||
|
||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
const totalCases = await casesPlugin.getTotalCasesByMod(modId);
|
||||
|
@ -57,7 +59,7 @@ export const CasesModCmd = modActionsCmd({
|
|||
const embed = {
|
||||
author: {
|
||||
name: title,
|
||||
icon_url: mod instanceof User ? mod.displayAvatarURL() : undefined,
|
||||
icon_url: mod instanceof User || mod instanceof GuildMember ? mod.displayAvatarURL() : undefined,
|
||||
},
|
||||
fields: [
|
||||
...getChunkedEmbedFields(emptyEmbedValue, lines.join("\n")),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue