3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 17:45:03 +00:00

remove non-functional hack

This commit is contained in:
almeidx 2021-10-31 18:34:42 +00:00
parent e12d544e2c
commit 0f39650d06
No known key found for this signature in database
GPG key ID: F403F80B79353CB4

View file

@ -1,6 +1,5 @@
import { typedGuildEventListener } from "knub";
import { RecentActionType } from "../constants";
import { GuildSavedMessages } from "../../../data/GuildSavedMessages";
import { runAutomod } from "../functions/runAutomod";
import { AutomodContext, AutomodPluginType } from "../types";
@ -21,19 +20,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(() => {
pluginData.state.recentActions.push({
type: RecentActionType.ThreadCreate,