JavaScript Discord - Add into users nickname then remove added word discord force user into voice channel

I created an AFK command for my discord bot but I am struggling to figure out how I would add "[AFK]" into the current users nickname.

Below is what I have but this takes the users discord name instead of nickname and adds "[AFK]" to it.

message.member.setNickname(`[AFK] ${message.author.username}`)

Then I would like to remove [AFK] from their nickname when the "if afk" statement is triggered (I have already wrote the if statement) but keep the rest.

Thanks in advance

Answer:1

I'm currently writing an e2e test and I would like to create some classes which abstract certain async tasks for me. In the end I would like to instantiate an object, which let's me chain async ...

I'm currently writing an e2e test and I would like to create some classes which abstract certain async tasks for me. In the end I would like to instantiate an object, which let's me chain async ...

  1. function chaining with return
  2. function chaining in javascript
  3. function chaining in c++
  4. function chaining in python
  5. function chaining in java
  6. function chaining in jquery
  7. function chaining in node js
  8. function chaining in php
  9. function chaining in java 8
  10. function chaining in js
  11. function chaining in scala
  12. function chaining in rust
  13. distributed function chaining with anycast routing

Is Array.from(arguments) worse in some way then Array.prototype.slice.call(arguments) for creating an array of arguments? I haven't seen the former used anywhere, and the latter seems to be the ...

Is Array.from(arguments) worse in some way then Array.prototype.slice.call(arguments) for creating an array of arguments? I haven't seen the former used anywhere, and the latter seems to be the ...

I would like to perform a logical OR operation on arrays in javascript, so that performing this operation on arrays a and b let a = [0,1,0] let b = [0,0,5] gives me OR(a, b) [0,1,5] What would be ...

I would like to perform a logical OR operation on arrays in javascript, so that performing this operation on arrays a and b let a = [0,1,0] let b = [0,0,5] gives me OR(a, b) [0,1,5] What would be ...

I was wondering how I can make my canvas resize along with my browser window? As it is right now, using innerWidth and innerHeight, it will only size to the initial browser width and height. How do I ...

I was wondering how I can make my canvas resize along with my browser window? As it is right now, using innerWidth and innerHeight, it will only size to the initial browser width and height. How do I ...

  1. resize html canvas
  2. resize html canvas element
  3. html resize canvas to fit image
  4. resize canvas html javascript
  5. html resize canvas image
  6. html autosize canvas
  7. resize video canvas html
  8. html canvas resize event
  9. html canvas resize with window
  10. html canvas resize scale
  11. html canvas resize rectangle
  12. html canvas resize to fit
  13. html canvas resize shape