Discord voice channel users' nickname print command

first of all, I’m not good at english…

I wanted to make a command that show certain discord voice channel users’ nicknames.

It wasn’t hard. I use a code from https://gist.github.com/Aaron128l/ce59040013ba3a90af63e49b802075e8

$(eval var members = $(urlfetch json https://canary.discordapp.com/api/guilds/(channel id)/widget.json).members.filter(x => x.channel_id === ‘(voice channel id)’).map(x => x.username); ${members})

but I had a problem. If no one in this voice channel, this command shows [Error Connecting To WebEval Service]

I want to make this command to show a message when no one is in the channel; ‘Playing games alone’

I don’t know programming well. I tried a lot of method, but I couldn’t find solutions…

I think the problem is ‘filter’, however I don’t know how to replace it. I was failed to use if, try-catch, etc.

plz help me…

$(eval $(urlfetch json https://canary.discordapp.com/api/guilds/CHANNEL_ID/widget.json).members.filter(x=>x.channel_id===`VOICE_CHANNEL_ID`).map(x=>x.username).join(`, `)||`Playing games alone`)

this code wasn’s working but I modified it so I can use correct command

Thanks!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.