Elimino los embedBuilder y los cambio por Components Message V2, algo tardado.

This commit is contained in:
2025-09-18 11:43:47 -05:00
parent 286b724eef
commit 58bb3844ad
15 changed files with 1730 additions and 137 deletions

View File

@@ -1,12 +1,20 @@
import {Guild, User} from "discord.js";
export async function replaceVars(text: string, user: User | undefined, guild:
Guild | undefined, stats: any) {
if(!text) return;
export async function replaceVars(text: string, user: User | undefined, guild: Guild | undefined, stats?: any): Promise<string> {
if(!text) return '';
return text
.replace(/(user.name)/g, user!.username ?? '')
.replace(/(user.id)/g, user!.id ?? '')
.replace(/(user.mention)/g, `<@${user!.id}>`)
.replace(/(user.avatar)/g, user!.displayAvatarURL({ forceStatic: false }))
/**
* USER INFO
*/
.replace(/(user\.name)/g, user?.username ?? '')
.replace(/(user\.id)/g, user?.id ?? '')
.replace(/(user\.mention)/g, user ? `<@${user.id}>` : '')
.replace(/(user\.avatar)/g, user?.displayAvatarURL({ forceStatic: false }) ?? '')
/**
* GUILD INFO
*/
.replace(/(guild\.name)/g, guild?.name ?? '')
.replace(/(guild\.icon)/g, guild?.iconURL({ forceStatic: false }) ?? '');
}