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:
parent
b2755a754b
commit
574f56b7bb
2 changed files with 4 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue