-
I play in a D&D server with multiple games going on all the time. I would like to be able to change the nickname of an individual on the fly based on what day of the week it is. Is it possible to change the nickname of an individual? |
Beta Was this translation helpful? Give feedback.
Answered by
mbround18
Sep 2, 2022
Replies: 1 comment 1 reply
-
In case anyone else needs it :) fyi you cant edit the owner of the servers nickname with a bot #[command]
async fn command_name(_ctx: &Context, msg: &Message) -> CommandResult {
let token = env::var("DISCORD_TOKEN").expect("token");
let http = HttpBuilder::new(token).build();
let mut payload = JsonMap::new();
payload.insert(
"nick".to_string(),
Value::from("Banana Phone"),
);
http.edit_member(
msg.guild_id.expect("Guild ID is not present!").0,
msg.author.id.0,
&payload,
Some("Its Karl..."),
)
.await
.expect("Failed to set nickname");
Ok(())
}
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mbround18
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case anyone else needs it :) fyi you cant edit the owner of the servers nickname with a bot