コード例 #1
0
        private async Task unrevokeCommand(IUser user)
        {
            try
            {
                string output = "";
                RevokedRoleCommandAccessUsers revokedUser = new RevokedRoleCommandAccessUsers();

                revokedUser = revokedUser.find($"{user.Id}") as RevokedRoleCommandAccessUsers;

                if (revokedUser != null)
                {
                    revokedUser.delete();
                    output += "User removed from the list";
                }
                else
                {
                    output += "User not found on the list";
                }

                await ReplyAsync(output);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #2
0
ファイル: AdminModule.cs プロジェクト: Sammca/CoOpBot
        private Boolean isPermitted()
        {
            RevokedRoleCommandAccessUsers revokedRoleCommandAccessUsers = new RevokedRoleCommandAccessUsers();
            ulong callerID = this.Context.User.Id;

            revokedRoleCommandAccessUsers = revokedRoleCommandAccessUsers.find($"{callerID}") as RevokedRoleCommandAccessUsers;

            if (revokedRoleCommandAccessUsers == null)
            {
                return(true);
            }

            if (revokedRoleCommandAccessUsers.userID == callerID)
            {
                return(false);
            }
            return(true);
        }