Lunix46
Lunix46

Reputation: 130

Change nickname on bot discordbot c#

So, I'm trying to change the nickname on the bot to the username of the command sender (?) So here is what I got going now but it changes the name to the id of the user?

        commands.CreateCommand("tts")
                     .Parameter("userMsg", ParameterType.Unparsed)
                     .Do(async (e) =>
                     {
                         var server = _client.GetServer(*server id*);
                         var user = server.GetUser(_client.CurrentUser.Id);
                         await user.Edit(nickname: e.User.Mention);
                         string UserMsg = e.GetArg("userMsg");
                         await e.Channel.SendTTSMessage(UserMsg);
                     });
    }

What I got going now only changes the bots name to the userid but I don't want that? I've also tried to search around but can't really find anything?

Thanks in advance!

Upvotes: 2

Views: 2252

Answers (1)

Bond_009
Bond_009

Reputation: 66

Change e.User.Mention to e.User.Name

Upvotes: 2

Related Questions