Skip to content

Instantly share code, notes, and snippets.

@alaingilbert
Last active August 17, 2023 16:47
Show Gist options
  • Save alaingilbert/5152074 to your computer and use it in GitHub Desktop.
Save alaingilbert/5152074 to your computer and use it in GitHub Desktop.
Get your current avatar id.
bot.on 'roomChanged', (data) ->
for user in data.users
if user.userid == bot.userId
console.log user.avatarid
break
# Equivalent javascript code.
bot.on('roomChanged', function(data) {
for (i = 0; i < data.users.length; i++) {
var user = data.users[i];
if (user.userid == bot.userId) {
console.log(user.avatarid);
break;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment