mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
Type fixes for djs
This commit is contained in:
parent
653d6c1dc2
commit
0822fc15e5
130 changed files with 8877 additions and 411 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Message, TextChannel } from "discord.js";
|
||||
import { Message, MessageEmbed, Snowflake, TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { StarboardPluginType, TStarboardOpts } from "../types";
|
||||
import { createStarboardEmbedFromMessage } from "./createStarboardEmbedFromMessage";
|
||||
|
@ -9,13 +9,13 @@ export async function saveMessageToStarboard(
|
|||
msg: Message,
|
||||
starboard: TStarboardOpts,
|
||||
) {
|
||||
const channel = pluginData.guild.channels.cache.get(starboard.channel_id);
|
||||
const channel = pluginData.guild.channels.cache.get(starboard.channel_id as Snowflake);
|
||||
if (!channel) return;
|
||||
|
||||
const starCount = (await pluginData.state.starboardReactions.getAllReactionsForMessageId(msg.id)).length;
|
||||
const embed = createStarboardEmbedFromMessage(msg, Boolean(starboard.copy_full_embed), starboard.color);
|
||||
embed.fields!.push(createStarboardPseudoFooterForMessage(starboard, msg, starboard.star_emoji![0], starCount));
|
||||
|
||||
const starboardMessage = await (channel as TextChannel).send(embed);
|
||||
const starboardMessage = await (channel as TextChannel).send({ embeds: [embed as MessageEmbed] });
|
||||
await pluginData.state.starboardMessages.createStarboardMessage(channel.id, msg.id, starboardMessage.id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue