You are brown.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 line
610 B

  1. /* eslint-disable @typescript-eslint/no-unsafe-member-access */
  2. import { Message, TextChannel } from 'discord.js';
  3. import messages from '../messages.json';
  4. import { transferPin } from '../utils/common';
  5. const pin = async (
  6. message: Message, pinTextChannel: TextChannel, silent = false,
  7. ): Promise<void> => {
  8. const isReply = message.type === 'REPLY';
  9. if (!isReply) {
  10. await message.reply(messages.NOTHING_TO_PIN);
  11. return;
  12. }
  13. const reply = await message.fetchReference();
  14. await transferPin(reply, pinTextChannel, silent);
  15. await message.reply(messages.PIN_COMPLETE);
  16. };
  17. export default pin;