3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 13:51:51 +00:00

use c.thread

This commit is contained in:
metal 2021-09-14 15:38:41 +00:00 committed by GitHub
parent b2755a754b
commit 574f56b7bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -13,8 +13,8 @@ export const ArchiveThreadAction = automodAction({
async apply({ pluginData, contexts, actionConfig }) {
const threads = contexts
.filter((c) => c.message?.channel_id)
.map((c) => pluginData.guild.channels.cache.get(c.message!.channel_id))
.filter((c) => c.thread?.id)
.map((c) => pluginData.guild.channels.cache.get(c.thread!.id))
.filter((c): c is ThreadChannel => c?.isThread() ?? false);
for (const thread of threads) {

View file

@ -13,8 +13,8 @@ export const UnArchiveThreadAction = automodAction({
async apply({ pluginData, contexts, actionConfig }) {
const threads = contexts
.filter((c) => c.message?.channel_id)
.map((c) => pluginData.guild.channels.cache.get(c.message!.channel_id))
.filter((c) => c.thread?.id)
.map((c) => pluginData.guild.channels.cache.get(c.thread!.id))
.filter((c): c is ThreadChannel => c?.isThread() ?? false);
for (const thread of threads) {