mirror of
https://github.com/danbulant/Shasha
synced 2026-07-06 11:30:48 +00:00
Change embed looks
This commit is contained in:
parent
93549b912a
commit
17a6f7aab6
4 changed files with 17 additions and 13 deletions
1
.xsh.sh
Executable file
1
.xsh.sh
Executable file
|
|
@ -0,0 +1 @@
|
||||||
|
#!zsh
|
||||||
|
|
@ -134,24 +134,25 @@ module.exports = class mute extends commando.Command {
|
||||||
|
|
||||||
if (muted.length > 0) await msg.guild.addInfraction(infractionToDoc);
|
if (muted.length > 0) await msg.guild.addInfraction(infractionToDoc);
|
||||||
|
|
||||||
const emb = defaultImageEmbed(msg, null, "Infraction #" + infractionToDoc.infraction);
|
const emb = defaultEventLogEmbed(msg.guild);
|
||||||
let mutedStr = "", mutedArr = [];
|
let mutedStr = "", mutedArr = [];
|
||||||
|
|
||||||
if (muted.length > 0) for (const U of muted) {
|
if (muted.length > 0) for (const U of muted) {
|
||||||
const tU = "<@" + U + ">\n";
|
const tU = "<@" + U + ">, ";
|
||||||
if ((mutedStr + tU).length < 1000) mutedStr += tU; else mutedArr.push(U);
|
if ((mutedStr + tU).length < 1000) mutedStr += tU; else mutedArr.push(U);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mutedArr.length > 0) mutedStr += `and ${mutedArr.length} more...`;
|
if (mutedArr.length > 0) mutedStr += `and ${mutedArr.length} more...`;
|
||||||
|
if (already.length > 0) emb.addField("Already muted", "<@" + already.join(">, <@") + ">\n\nDuration updated for these users");
|
||||||
|
|
||||||
emb.setDescription("**Reason**\n" + reason)
|
emb.setTitle("Infraction #" + infractionToDoc.infraction)
|
||||||
|
.setDescription("**Reason**\n" + reason)
|
||||||
.addField("Muted", mutedStr || "`[NONE]`")
|
.addField("Muted", mutedStr || "`[NONE]`")
|
||||||
.addField("At", defaultDateFormat(duration.invoked), true)
|
.addField("At", defaultDateFormat(duration.invoked), true)
|
||||||
.addField("Until", duration.until ? defaultDateFormat(duration.until) : "Never", true)
|
.addField("Until", duration.until ? defaultDateFormat(duration.until) : "Never", true)
|
||||||
.addField("For", duration.duration?.strings.join(" ") || "Indefinite");
|
.addField("For", duration.duration?.strings.join(" ") || "Indefinite");
|
||||||
|
|
||||||
if (cant.length > 0) emb.addField("Can't mute", "<@" + cant.join(">, <@") + ">\n\n**You can't mute someone with higher position than you <:nekokekLife:852865942530949160>**");
|
if (cant.length > 0) emb.addField("Can't mute", "<@" + cant.join(">, <@") + ">\n\n**You can't mute someone with higher position than you <:nekokekLife:852865942530949160>**");
|
||||||
if (already.length > 0) emb.addField("Already muted", "<@" + already.join(">, <@") + ">\n\nDuration updated for these users");
|
|
||||||
|
|
||||||
return trySend(msg.client, msg, { content: resultMsg, embed: emb });
|
return trySend(msg.client, msg, { content: resultMsg, embed: emb });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,13 @@ module.exports = class unmute extends commando.Command {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const emb = defaultImageEmbed(msg, null, "Unmute");
|
const emb = defaultEventLogEmbed(msg.guild);
|
||||||
emb.setDescription("**Reason**\n" + reason)
|
if (notMuted.length > 0) emb.addField("Wasn't muted", "<@" + notMuted.join(">, <@") + ">");
|
||||||
|
|
||||||
|
emb.setTitle("Unmute")
|
||||||
|
.setDescription("**Reason**\n" + reason)
|
||||||
.addField("Unmuted", (success.length > 0 ? "<@" + success.join(">, <@") + ">" : "`[NONE]`"));
|
.addField("Unmuted", (success.length > 0 ? "<@" + success.join(">, <@") + ">" : "`[NONE]`"));
|
||||||
if (cant.length > 0) emb.addField("Can't unmute", "<@" + cant.join(">, <@") + ">");
|
if (cant.length > 0) emb.addField("Can't unmute", "<@" + cant.join(">, <@") + ">");
|
||||||
if (notMuted.length > 0) emb.addField("Wasn't muted", "<@" + notMuted.join(">, <@") + ">");
|
|
||||||
return trySend(msg.client, msg, { content: resultMsg, embed: emb });
|
return trySend(msg.client, msg, { content: resultMsg, embed: emb });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -202,8 +202,8 @@ Structures.extend("User", u => {
|
||||||
const MEM = guild.member(this);
|
const MEM = guild.member(this);
|
||||||
const CL = guild.member(this.client.user);
|
const CL = guild.member(this.client.user);
|
||||||
|
|
||||||
if (!CL.hasPermission("MANAGE_ROLES") ||
|
if (!(CL.isAdmin || CL.hasPermission("MANAGE_ROLES")) ||
|
||||||
!data.moderator.hasPermission("MANAGE_ROLES")) throw new Error("Missing Permissions");
|
!(data.moderator.idAdmin || data.moderator.hasPermission("MANAGE_ROLES"))) throw new Error("Missing Permissions");
|
||||||
|
|
||||||
if (MEM) {
|
if (MEM) {
|
||||||
if (data.moderator.roles.highest.position < MEM.roles.highest.position || MEM.roles.highest.position > guild.member(this.client.user).roles.highest.position) throw new Error("You can't mute someone with higher position than you <:nekokekLife:852865942530949160>");
|
if (data.moderator.roles.highest.position < MEM.roles.highest.position || MEM.roles.highest.position > guild.member(this.client.user).roles.highest.position) throw new Error("You can't mute someone with higher position than you <:nekokekLife:852865942530949160>");
|
||||||
|
|
@ -238,8 +238,8 @@ Structures.extend("User", u => {
|
||||||
if (!guild || !(guild instanceof Guild)) throw new TypeError("Guild is: " + guild);
|
if (!guild || !(guild instanceof Guild)) throw new TypeError("Guild is: " + guild);
|
||||||
const MEM = guild.member(this);
|
const MEM = guild.member(this);
|
||||||
const CL = guild.member(this.client.user);
|
const CL = guild.member(this.client.user);
|
||||||
if (!CL.hasPermission("MANAGE_ROLES") ||
|
if (!(CL.isAdmin || CL.hasPermission("MANAGE_ROLES")) ||
|
||||||
!moderator.hasPermission("MANAGE_ROLES")) throw new Error("Missing Permissions");
|
!(moderator.idAdmin || moderator.hasPermission("MANAGE_ROLES"))) throw new Error("Missing Permissions");
|
||||||
if (!guild.DB) await guild.dbLoad();
|
if (!guild.DB) await guild.dbLoad();
|
||||||
|
|
||||||
if (!this.bot) {
|
if (!this.bot) {
|
||||||
|
|
@ -272,8 +272,8 @@ Structures.extend("User", u => {
|
||||||
if (!data?.infraction) throw new Error("Missing infraction id");
|
if (!data?.infraction) throw new Error("Missing infraction id");
|
||||||
const MEM = guild.member(this);
|
const MEM = guild.member(this);
|
||||||
const CL = guild.member(this.client.user);
|
const CL = guild.member(this.client.user);
|
||||||
if (!CL.hasPermission("BAN_MEMBERS") ||
|
if (!(CL.isAdmin || CL.hasPermission("BAN_MEMBERS")) ||
|
||||||
!data.moderator.hasPermission("BAN_MEMBERS")) throw new Error("Missing Permissions");
|
!(data.moderation.isAdmin || data.moderator.hasPermission("BAN_MEMBERS"))) throw new Error("Missing Permissions");
|
||||||
if (MEM) {
|
if (MEM) {
|
||||||
if (moderator.roles.highest.position < MEM.roles.highest.position ||
|
if (moderator.roles.highest.position < MEM.roles.highest.position ||
|
||||||
MEM.roles.highest.position > CL.roles.highest.position)
|
MEM.roles.highest.position > CL.roles.highest.position)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue