|
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
- import { Message, TextChannel } from 'discord.js';
- import messages from '../messages.json';
- import { transferPin } from '../utils/common';
-
- const pin = async (
- message: Message, pinTextChannel: TextChannel, silent = false,
- ): Promise<void> => {
- const isReply = message.type === 'REPLY';
- if (!isReply) {
- await message.reply(messages.NOTHING_TO_PIN);
- return;
- }
-
- const reply = await message.fetchReference();
- await transferPin(reply, pinTextChannel, silent);
- await message.reply(messages.PIN_COMPLETE);
- };
-
- export default pin;
|