mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 02:57:20 +00:00
Merge master
This commit is contained in:
commit
1518d58e25
53 changed files with 289 additions and 320 deletions
|
@ -1,6 +1,6 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { renderUserUsername, zSnowflake } from "../../../utils";
|
||||
import { zSnowflake } from "../../../utils";
|
||||
import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
|
@ -38,7 +38,7 @@ export const RoleAddedTrigger = automodTrigger<RoleAddedMatchResult>()({
|
|||
const role = pluginData.guild.roles.cache.get(matchResult.extra.matchedRoleId as Snowflake);
|
||||
const roleName = role?.name || "Unknown";
|
||||
const member = contexts[0].member!;
|
||||
const memberName = `**${renderUserUsername(member.user)}** (\`${member.id}\`)`;
|
||||
const memberName = `**${renderUsername(member)}** (\`${member.id}\`)`;
|
||||
return `Role ${roleName} (\`${matchResult.extra.matchedRoleId}\`) was added to ${memberName}`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { renderUserUsername, zSnowflake } from "../../../utils";
|
||||
import { zSnowflake } from "../../../utils";
|
||||
import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
|
@ -38,7 +38,7 @@ export const RoleRemovedTrigger = automodTrigger<RoleAddedMatchResult>()({
|
|||
const role = pluginData.guild.roles.cache.get(matchResult.extra.matchedRoleId as Snowflake);
|
||||
const roleName = role?.name || "Unknown";
|
||||
const member = contexts[0].member!;
|
||||
const memberName = `**${renderUserUsername(member.user)}** (\`${member.id}\`)`;
|
||||
const memberName = `**${renderUsername(member)}** (\`${member.id}\`)`;
|
||||
return `Role ${roleName} (\`${matchResult.extra.matchedRoleId}\`) was removed from ${memberName}`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { User, escapeBold, type Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { renderUsername } from "../../../utils";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
interface ThreadArchiveResult {
|
||||
|
@ -47,7 +48,7 @@ export const ThreadArchiveTrigger = automodTrigger<ThreadArchiveResult>()({
|
|||
const parentName = matchResult.extra.matchedThreadParentName;
|
||||
const base = `Thread **#${threadName}** (\`${threadId}\`) has been archived in the **#${parentName}** (\`${parentId}\`) channel`;
|
||||
if (threadOwner) {
|
||||
return `${base} by **${escapeBold(threadOwner.tag)}** (\`${threadOwner.id}\`)`;
|
||||
return `${base} by **${escapeBold(renderUsername(threadOwner))}** (\`${threadOwner.id}\`)`;
|
||||
}
|
||||
return base;
|
||||
},
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { User, escapeBold, type Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { renderUsername } from "../../../utils.js";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
interface ThreadCreateResult {
|
||||
|
@ -41,7 +42,7 @@ export const ThreadCreateTrigger = automodTrigger<ThreadCreateResult>()({
|
|||
const parentName = matchResult.extra.matchedThreadParentName;
|
||||
const base = `Thread **#${threadName}** (\`${threadId}\`) has been created in the **#${parentName}** (\`${parentId}\`) channel`;
|
||||
if (threadOwner) {
|
||||
return `${base} by **${escapeBold(threadOwner.tag)}** (\`${threadOwner.id}\`)`;
|
||||
return `${base} by **${escapeBold(renderUsername(threadOwner))}** (\`${threadOwner.id}\`)`;
|
||||
}
|
||||
return base;
|
||||
},
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { User, escapeBold, type Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { renderUsername } from "../../../utils.js";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
interface ThreadDeleteResult {
|
||||
|
@ -41,7 +42,7 @@ export const ThreadDeleteTrigger = automodTrigger<ThreadDeleteResult>()({
|
|||
const parentName = matchResult.extra.matchedThreadParentName;
|
||||
if (threadOwner) {
|
||||
return `Thread **#${threadName ?? "Unknown"}** (\`${threadId}\`) created by **${escapeBold(
|
||||
threadOwner.tag,
|
||||
renderUsername(threadOwner),
|
||||
)}** (\`${threadOwner.id}\`) in the **#${parentName}** (\`${parentId}\`) channel has been deleted`;
|
||||
}
|
||||
return `Thread **#${
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { User, escapeBold, type Snowflake } from "discord.js";
|
||||
import z from "zod";
|
||||
import { renderUsername } from "../../../utils";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
interface ThreadUnarchiveResult {
|
||||
|
@ -47,7 +48,7 @@ export const ThreadUnarchiveTrigger = automodTrigger<ThreadUnarchiveResult>()({
|
|||
const parentName = matchResult.extra.matchedThreadParentName;
|
||||
const base = `Thread **#${threadName}** (\`${threadId}\`) has been unarchived in the **#${parentName}** (\`${parentId}\`) channel`;
|
||||
if (threadOwner) {
|
||||
return `${base} by **${escapeBold(threadOwner.tag)}** (\`${threadOwner.id}\`)`;
|
||||
return `${base} by **${escapeBold(renderUsername(threadOwner))}** (\`${threadOwner.id}\`)`;
|
||||
}
|
||||
return base;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue