mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
More fixes, change rest of stripObjectToScalars to configAccessibleObj
This commit is contained in:
parent
4ad99975de
commit
acb4913495
66 changed files with 623 additions and 192 deletions
|
@ -1,5 +1,6 @@
|
|||
import { Guild, Snowflake } from "discord.js";
|
||||
import moment from "moment-timezone";
|
||||
import { isDefaultSticker } from "src/utils/isDefaultSticker";
|
||||
import { getRepository, Repository } from "typeorm";
|
||||
import { renderTemplate } from "../templateFormatter";
|
||||
import { trimLines } from "../utils";
|
||||
|
@ -13,7 +14,7 @@ const MESSAGE_ARCHIVE_HEADER_FORMAT = trimLines(`
|
|||
Server: {guild.name} ({guild.id})
|
||||
`);
|
||||
const MESSAGE_ARCHIVE_MESSAGE_FORMAT =
|
||||
"[#{channel.name}] [{user.id}] [{timestamp}] {user.username}#{user.discriminator}: {content}{attachments}";
|
||||
"[#{channel.name}] [{user.id}] [{timestamp}] {user.username}#{user.discriminator}: {content}{attachments}{stickers}";
|
||||
|
||||
export class GuildArchives extends BaseGuildRepository {
|
||||
protected archives: Repository<ArchiveEntry>;
|
||||
|
@ -80,6 +81,12 @@ export class GuildArchives extends BaseGuildRepository {
|
|||
id: msg.id,
|
||||
timestamp: moment.utc(msg.posted_at).format("YYYY-MM-DD HH:mm:ss"),
|
||||
content: msg.data.content,
|
||||
attachments: msg.data.attachments?.map(att => {
|
||||
return JSON.stringify({ name: att.name, url: att.url, type: att.contentType });
|
||||
}),
|
||||
stickers: msg.data.stickers?.map(sti => {
|
||||
return JSON.stringify({ name: sti.name, id: sti.id, isDefault: isDefaultSticker(sti.id) });
|
||||
}),
|
||||
user,
|
||||
channel,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { GuildChannel, Message } from "discord.js";
|
||||
import moment from "moment-timezone";
|
||||
import { getRepository, Repository } from "typeorm";
|
||||
import { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
|
||||
import { isAPI } from "../globals";
|
||||
import { QueuedEventEmitter } from "../QueuedEventEmitter";
|
||||
import { MINUTES, SECONDS } from "../utils";
|
||||
|
@ -222,7 +223,7 @@ export class GuildSavedMessages extends BaseGuildRepository {
|
|||
// FIXME?
|
||||
{ id },
|
||||
{
|
||||
data: newData,
|
||||
data: newData as QueryDeepPartialEntity<ISavedMessageData>,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue