예제 #1
0
 public async Task AddSpecialUser(IGuildUser user)
 {
     if (user.HasPerms(Context.Channel as ITextChannel, PermissionsExtensions.DiscordPermissions.READ_MESSAGES | PermissionsExtensions.DiscordPermissions.SEND_MESSAGES))
     {
         if (await _permService.AddSpecialUser(Context.Channel as ITextChannel, user).ConfigureAwait(false))
         {
             await ReplyAsync($"Gave **{user.Username}** Special command privileges.").ConfigureAwait(false);
         }
     }
     else
     {
         await ReplyAsync("That user has no read/write permissions in this channel.").ConfigureAwait(false);
     }
 }
예제 #2
0
        public async Task AddSpecialUser(IGuildUser user)
        {
            var perms = user.GetPermissions(Context.Channel as ITextChannel);

            if (perms.ReadMessages && perms.SendMessages)
            {
                if (await _permService.AddSpecialUser(Context.Channel as ITextChannel, user).ConfigureAwait(false))
                {
                    await ReplyAsync($"Gave **{user.Username}** Special command privileges.").ConfigureAwait(false);
                }
            }
            else
            {
                await ReplyAsync("That user has no read/write permissions in this channel.").ConfigureAwait(false);
            }
        }