Skip to content

Commit

Permalink
Merge pull request #120 from Devscord-Team/fix-avatar-command
Browse files Browse the repository at this point in the history
fix-avatar-command
  • Loading branch information
Marcin99b authored Dec 18, 2020
2 parents c416f4b + 5e5230a commit ad30699
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Watchman.Discord/Areas/Users/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public UsersController(IQueryBus queryBus, MessagesServiceFactory messagesServic
this._responsesService = responsesService;
}

public Task GetAvatar(AvatarCommand avatarCommand, Contexts contexts)
public async Task GetAvatar(AvatarCommand avatarCommand, Contexts contexts)
{
var messageService = this._messagesServiceFactory.Create(contexts);
var user = contexts.User;
if (avatarCommand.User != 0)
{
user = this._usersService.GetUserByIdAsync(contexts.Server, avatarCommand.User).GetAwaiter().GetResult();
user = await this._usersService.GetUserByIdAsync(contexts.Server, avatarCommand.User);
}
if (string.IsNullOrEmpty(user.AvatarUrl))
{
return messageService.SendResponse(x => x.UserDoesntHaveAvatar(contexts.User));
await messageService.SendResponse(x => x.UserDoesntHaveAvatar(user));
}
return messageService.SendMessage(contexts.User.AvatarUrl);
await messageService.SendMessage(user.AvatarUrl);
}

public Task AddRole(AddRoleCommand addRoleCommand, Contexts contexts)
Expand Down

0 comments on commit ad30699

Please sign in to comment.