#remove something specific from someones nickname

10 messages · Page 1 of 1 (latest)

karmic cairn
#

i want to make a bot where if someone has a nickname for example kermit - kelp it removes the - kelp and only keeps kermit, how do i do this? i tried before ( im an amateur; started like a 3 weeks ago) and i just kept getting errors

clever haloBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
faint gustBOT
#

method GuildMember#setNickname @14.15.2
Sets the nickname for this member.

// Set a nickname for a guild member
guildMember.setNickname('cool nickname', 'Needed a new nickname')
  .then(member => console.log(`Set nickname of ${member.user.username}`))
  .catch(console.error);

shy patio
karmic cairn
#

is that possible?

faint gustBOT
#

method GuildMemberManager#fetch @14.15.2
Fetches member(s) from a guild.

// Fetch all members from a guild
guild.members.fetch()
  .then(console.log)
  .catch(console.error);

shy patio
#

just iterate there