3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +00:00

feat: new username support vol 2

This commit is contained in:
Dragory 2023-06-24 12:07:58 +00:00
parent ecaa16bf7c
commit 63c41f0278
29 changed files with 105 additions and 64 deletions

View file

@ -67,7 +67,7 @@ export const StartThreadAction = automodAction({
msg: savedMessageToTemplateSafeSavedMessage(threadContext.message!),
}),
);
const threadName = await renderThreadName(actionConfig.name ?? "{user.tag}s thread");
const threadName = await renderThreadName(actionConfig.name ?? "{user.renderedUsername}'s thread");
const threadOptions: GuildTextThreadCreateOptions<unknown> = {
name: threadName,
autoArchiveDuration: autoArchive,

View file

@ -1,5 +1,6 @@
import { Snowflake } from "discord.js";
import * as t from "io-ts";
import { renderUserUsername } from "../../../utils";
import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges";
import { automodTrigger } from "../helpers";
@ -37,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 = `**${member.user.tag}** (\`${member.id}\`)`;
const memberName = `**${renderUserUsername(member.user)}** (\`${member.id}\`)`;
return `Role ${roleName} (\`${matchResult.extra.matchedRoleId}\`) was added to ${memberName}`;
},
});

View file

@ -1,5 +1,6 @@
import { Snowflake } from "discord.js";
import * as t from "io-ts";
import { renderUserUsername } from "../../../utils";
import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges";
import { automodTrigger } from "../helpers";
@ -37,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 = `**${member.user.tag}** (\`${member.id}\`)`;
const memberName = `**${renderUserUsername(member.user)}** (\`${member.id}\`)`;
return `Role ${roleName} (\`${matchResult.extra.matchedRoleId}\`) was removed from ${memberName}`;
},
});