Add current voice channel to thread header

master
Dragory 2019-03-28 04:57:21 +02:00
parent 073f3a87ea
commit 3d077cb252
1 changed files with 11 additions and 2 deletions

View File

@ -176,10 +176,19 @@ async function createNewThreadForUser(user, quiet = false) {
// Guild member info // Guild member info
for (const [guildId, guildData] of userGuildData.entries()) { for (const [guildId, guildData] of userGuildData.entries()) {
const {nickname, joinDate} = getHeaderGuildInfo(guildData.member); const {nickname, joinDate} = getHeaderGuildInfo(guildData.member);
const headerStr = [ const headerItems = [
`NICKNAME **${nickname}**`, `NICKNAME **${nickname}**`,
`JOINED **${joinDate}** ago` `JOINED **${joinDate}** ago`
].join(', '); ];
if (guildData.member.voiceState.channelID) {
const voiceChannel = guildData.guild.channels.get(guildData.member.voiceState.channelID);
if (voiceChannel) {
headerItems.push(`VOICE CHANNEL **${voiceChannel.name}**`);
}
}
const headerStr = headerItems.join(', ');
if (mainGuilds.length === 1) { if (mainGuilds.length === 1) {
infoHeader += `\n${headerStr}`; infoHeader += `\n${headerStr}`;