3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-24 01:55:03 +00:00
This commit is contained in:
metal 2021-09-14 15:40:01 +00:00 committed by almeidx
parent e52db4dcd2
commit d23e430711
No known key found for this signature in database
GPG key ID: F403F80B79353CB4
3 changed files with 12 additions and 8 deletions

View file

@ -14,6 +14,7 @@ export const RunAutomodOnThreadCreate = typedGuildEventListener<AutomodPluginTyp
const context: AutomodContext = {
timestamp: Date.now(),
thread,
threadChange: {
created: thread,
},
@ -23,7 +24,7 @@ export const RunAutomodOnThreadCreate = typedGuildEventListener<AutomodPluginTyp
// 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);
messageBlock: if (sourceChannel?.isText()) {
if (sourceChannel?.isText()) {
const sourceMessage = sourceChannel.messages.cache.find(
(m) => m.thread?.id === thread.id || m.reference?.channelId === thread.id,
);
@ -56,6 +57,7 @@ export const RunAutomodOnThreadDelete = typedGuildEventListener<AutomodPluginTyp
const context: AutomodContext = {
timestamp: Date.now(),
thread,
threadChange: {
deleted: thread,
},
@ -84,10 +86,11 @@ export const RunAutomodOnThreadUpdate = typedGuildEventListener<AutomodPluginTyp
}
if (Object.keys(changes).length === 0) return;
console.log("got thread changes!");
const context: AutomodContext = {
timestamp: Date.now(),
threadChange: changes,
thread,
user,
};