Exemplo n.º 1
0
 public async Task ChangeNotificationType(ulong userId, ulong guildId, XpNotificationType type)
 {
     using (var uow = _db.UnitOfWork)
     {
         var user = uow.Xp.GetOrCreateUser(guildId, userId);
         user.NotifyOnLevelUp = type;
         await uow.CompleteAsync();
     }
 }
Exemplo n.º 2
0
 public async Task ChangeNotificationType(IUser user, XpNotificationType type)
 {
     using (var uow = _db.UnitOfWork)
     {
         var du = uow.DiscordUsers.GetOrCreate(user);
         du.NotifyOnLevelUp = type;
         await uow.CompleteAsync();
     }
 }
Exemplo n.º 3
0
 public async Task XpNotify(NotifyPlace place = NotifyPlace.Guild, XpNotificationType type = XpNotificationType.Channel)
 {
     if (place == NotifyPlace.Guild)
     {
         await _service.ChangeNotificationType(Context.User.Id, Context.Guild.Id, type);
     }
     else
     {
         await _service.ChangeNotificationType(Context.User, type);
     }
     await Context.Channel.SendConfirmAsync("👌").ConfigureAwait(false);
 }