feat: quote #42
1 changed files with 21 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
|||
import { Message, TextBasedChannel } from 'discord.js';
|
||||
import { Client, Message, MessageEmbed, TextBasedChannel } from 'discord.js';
|
||||
import { getLocale } from '../../utils/locales';
|
||||
import { showDate } from '../../utils/time';
|
||||
|
||||
/** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-messageCreate */
|
||||
export default async (message: Message) => {
|
||||
export default async (message: Message, client: Client) => {
|
||||
// Ignore message if
|
||||
if (
|
||||
// Author is a bot
|
||||
|
@ -73,4 +75,21 @@ export default async (message: Message) => {
|
|||
// Remove undefined elements
|
||||
).filter(Boolean);
|
||||
|
||||
messages.map(valid_message => {
|
||||
const embed = new MessageEmbed()
|
||||
.setColor('#2f3136')
|
||||
.setAuthor({
|
||||
name: 'Citation',
|
||||
iconURL: valid_message?.author.displayAvatarURL(),
|
||||
})
|
||||
.setFooter({
|
||||
text: `Message posté le ${showDate(
|
||||
client.config.default_lang,
|
||||
getLocale(client, client.config.default_lang),
|
||||
valid_message?.createdAt as Date)
|
||||
}`,
|
||||
});
|
||||
|
||||
return message.channel.send({ embeds: [embed] });
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue