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 */
|
/** 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
|
// Ignore message if
|
||||||
if (
|
if (
|
||||||
// Author is a bot
|
// Author is a bot
|
||||||
|
@ -73,4 +75,21 @@ export default async (message: Message) => {
|
||||||
// Remove undefined elements
|
// Remove undefined elements
|
||||||
).filter(Boolean);
|
).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