28 lines
698 B
TypeScript
28 lines
698 B
TypeScript
![]() |
import { EmbedField, EmojiOptions, GuildChannel, Message } from "eris";
|
||
|
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,
|
||
|
};
|
||
|
}
|