From cb7904ef818fd68355b25f49c2538f2748c20fdc Mon Sep 17 00:00:00 2001 From: Dragory Date: Wed, 20 Mar 2019 00:34:41 +0200 Subject: [PATCH] Utility: add voice information to !info, tweak embed styles a bit --- src/plugins/Utility.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/plugins/Utility.ts b/src/plugins/Utility.ts index 159683dd..eb5932ea 100644 --- a/src/plugins/Utility.ts +++ b/src/plugins/Utility.ts @@ -417,9 +417,9 @@ export class UtilityPlugin extends ZeppelinPlugin - Created: ${accountAge} ago (${createdAt.format("YYYY-MM-DD[T]HH:mm:ss")}) + Created: **${accountAge} ago (${createdAt.format("YYYY-MM-DD[T]HH:mm:ss")})** `) + embedPadding, }); } else { @@ -439,10 +439,23 @@ export class UtilityPlugin extends ZeppelinPlugin 0 ? "Roles: " + roles.map(r => r.name).join(", ") : ""} `) + embedPadding, }); + + const voiceChannel = member.voiceState.channelID ? this.guild.channels.get(member.voiceState.channelID) : null; + if (voiceChannel || member.voiceState.mute || member.voiceState.deaf) { + embed.fields.push({ + name: "Voice information", + value: + trimLines(` + ${voiceChannel ? `Current voice channel: **${voiceChannel ? voiceChannel.name : "None"}**` : ""} + ${member.voiceState.mute ? "Server voice muted: **Yes**" : ""} + ${member.voiceState.deaf ? "Server voice deafened: **Yes**" : ""} + `) + embedPadding, + }); + } } const cases = (await this.cases.getByUserId(args.userId)).filter(c => !c.is_hidden); @@ -461,7 +474,7 @@ export class UtilityPlugin extends ZeppelinPlugin