title: How To Get a User's Role with a DiscordSocketClient
body: <p>I have been locking for a long time on how to get a user's role so I can set permissions for commands.  This is my code.  I am using Discord.NET in the newer version. </p>
  
  <pre><code>using Discord.Commands;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace AmberScript2.Modules
  {
      public class Kick : ModuleBase&lt;SocketCommandContext&gt;
      {
          [Command("kick")]
          public async Task KickUser(string userName)
          {
              if (Context.Guild.GetRole(Context.Message.Author.Id).Name == "Administrator")
              {
                  await Context.Channel.SendMessageAsync("Success!");
              }
              else
              {
                  await Context.Channel.SendMessageAsync("Inadequate permisions.");
              }
          }
      }
  }
  </code></pre>
  
  <p>The error i am getting is object reference not set to an instance of an object.  I have been trying to find the source of it and i can't.  Thanks.</p>
  
  <p>(And yes i have yet to get rid of excess usings.  This code isn't done yet.)</p>