2021-06-02 04:07:50 +02:00
|
|
|
import { Message, EmbedField } from "discord.js";
|
2020-12-23 03:47:43 +02:00
|
|
|
import { EMPTY_CHAR, messageLink } from "../../../utils";
|
|
|
|
import { TStarboardOpts } from "../types";
|
|
|
|
|
|
|
|
export function createStarboardPseudoFooterForMessage(
|
|
|
|
starboard: TStarboardOpts,
|
|
|
|
msg: Message,
|
|
|
|
starEmoji: string,
|
|
|
|
starCount: number,
|
|
|
|
): EmbedField {
|
|
|
|
const jumpLink = `[Jump to message](${messageLink(msg)})`;
|
|
|
|
|
|
|
|
let content;
|
|
|
|
if (starboard.show_star_count) {
|
|
|
|
content =
|
|
|
|
starCount > 1
|
|
|
|
? `${starEmoji} **${starCount}** \u200B \u200B \u200B ${jumpLink}`
|
|
|
|
: `${starEmoji} \u200B ${jumpLink}`;
|
|
|
|
} else {
|
|
|
|
content = jumpLink;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
name: EMPTY_CHAR,
|
|
|
|
value: content,
|
2021-06-02 04:07:50 +02:00
|
|
|
inline: false,
|
2020-12-23 03:47:43 +02:00
|
|
|
};
|
|
|
|
}
|