3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

starboard: localized timestamps; add link to original message again

This commit is contained in:
Dragory 2019-12-02 01:11:40 +02:00
parent c7103ac432
commit 5ab6f59593
2 changed files with 7 additions and 2 deletions

View file

@ -11,6 +11,7 @@ import {
tNullable,
tDeepPartial,
UnknownUser,
EMPTY_CHAR,
} from "../utils";
import path from "path";
import moment from "moment-timezone";
@ -247,12 +248,12 @@ export class StarboardPlugin extends ZeppelinPlugin<TConfigSchema> {
const embed: EmbedBase = {
footer: {
text: `#${(msg.channel as GuildChannel).name} - ${time}`,
text: `#${(msg.channel as GuildChannel).name}`,
},
author: {
name: `${msg.author.username}#${msg.author.discriminator}`,
},
url: messageLink(msg),
timestamp: new Date(msg.timestamp).toISOString(),
};
if (msg.author.avatarURL) {
@ -280,6 +281,8 @@ export class StarboardPlugin extends ZeppelinPlugin<TConfigSchema> {
embed.image = msg.embeds[0].image;
}
embed.fields = [{ name: EMPTY_CHAR, value: `[Jump to message](${messageLink(msg)})` }];
const starboardMessage = await (channel as TextChannel).createMessage({ embed });
await this.starboardMessages.createStarboardMessage(channel.id, msg.id, starboardMessage.id);
}