forked from Sarah/Lieb-Website
fixed renaming users
This commit is contained in:
parent
778c262642
commit
412e707e25
2 changed files with 16 additions and 3 deletions
|
@ -64,13 +64,22 @@ namespace DiscordBot.CommandHandlers
|
|||
if(guild != null)
|
||||
{
|
||||
SocketGuildUser user = guild.GetUser(userId);
|
||||
if(user == null)
|
||||
{
|
||||
await guild.DownloadUsersAsync();
|
||||
user = guild.GetUser(userId);
|
||||
}
|
||||
if(user != null)
|
||||
{
|
||||
await user.ModifyAsync(p => p.Nickname = nickname);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {}
|
||||
catch(Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
Console.WriteLine(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue