mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 17:45:03 +00:00
remove config in favour of overrides
This commit is contained in:
parent
12c8d68992
commit
ae401a23f7
2 changed files with 0 additions and 30 deletions
|
@ -25,23 +25,6 @@ export class GuildSavedMessages extends BaseGuildRepository<SavedMessage> {
|
|||
this.toBePermanent = new Set();
|
||||
}
|
||||
|
||||
public msgToSavedMessage(message: Message): SavedMessage {
|
||||
const postedAt = moment.utc(message.createdTimestamp, "x").format("YYYY-MM-DD HH:mm:ss");
|
||||
|
||||
return {
|
||||
data: this.msgToSavedMessageData(message),
|
||||
id: message.id,
|
||||
guild_id: (message.channel as GuildChannel).guildId,
|
||||
channel_id: message.channelId,
|
||||
user_id: message.author.id,
|
||||
is_bot: message.author.bot,
|
||||
posted_at: postedAt,
|
||||
// @ts-expect-error
|
||||
deleted_at: null,
|
||||
is_permanent: false,
|
||||
};
|
||||
}
|
||||
|
||||
protected msgToSavedMessageData(msg: Message): ISavedMessageData {
|
||||
const data: ISavedMessageData = {
|
||||
author: {
|
||||
|
|
|
@ -18,19 +18,6 @@ export const RunAutomodOnThreadCreate = typedGuildEventListener<AutomodPluginTyp
|
|||
channel: thread,
|
||||
};
|
||||
|
||||
// This is a hack to make this trigger compatible with the reply action
|
||||
const sourceChannel = thread.parent ?? pluginData.client.channels.cache.find((c) => c.id === thread.parentId);
|
||||
if (sourceChannel?.isText()) {
|
||||
const sourceMessage = sourceChannel.messages.cache.find(
|
||||
(m) => m.thread?.id === thread.id || m.reference?.channelId === thread.id,
|
||||
);
|
||||
if (sourceMessage) {
|
||||
const savedMessage = pluginData.state.savedMessages.msgToSavedMessage(sourceMessage);
|
||||
savedMessage.channel_id = thread.id;
|
||||
context.message = savedMessage;
|
||||
}
|
||||
}
|
||||
|
||||
pluginData.state.queue.add(() => {
|
||||
runAutomod(pluginData, context);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue