You can get the Guild's icon using the iconURL()
method of Guild
.
client.on("guildCreate", guild => {
console.log(guild.iconURL({dynamic: true, size: 2048}));
});
Getting the members of the Guild is pretty straightforward. You can use the memberCount
property of Guild
.
client.on("guildCreate", guild => {
console.log(guild.memberCount);
});
Since Guild.members.cache
is a Collection
, you can as well map
the members by any property you'd like. (Id, username, discriminator, tag etc...)
client.on("guildCreate", guild => {
console.log(guild.members.cache.map(member => member.user.tag));
// --> ["Wumpus#0000", "entrynidy#1234"]
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…