title: "invalid_grant error processing request" while making a reddit bot
body: <p>Im making a reddit bot that replies something to a specific comment.</p>
  
  <p>But Im getting this error :  invalid_grant error processing request</p>
  
  <p>and I can't find the solution.</p>
  
  <p>here is my code, Im using Python.</p>
  
  <pre><code>import praw
  import time
  import config
  
  def login():
      r = praw.Reddit(user_agent = "test bot",
                  username = config.username,
                  password = config.password,
                  client_id = config.client_id,
                  client_secret = config.client_secret)
      print("logged in")
      return r
  
  
  cache = []
  
  def run_bot(r):
      subreddit = r.subreddit("Test")
      comments = subreddit.get_comments(limit=25)
      for comment in comments:
          comment_text = comment.body.lower()
          if "xD" in comment_text and comment.id not in cache:
              comment.reply("xD")
              cache.append(comment.id)
  
  while True:
      r = login()
      run_bot(r)
      time.sleep(5)
  </code></pre>
  
  <p>traceback:</p>
  
  <pre><code>    logged in
  Traceback (most recent call last):
    File "xdbot.py", line 28, in &lt;module&gt;
      run_bot(r)
    File "xdbot.py", line 19, in run_bot
      comments = subreddit.get_comments(limit=25)
    File "D:\Programming\Phyton\lib\site-packages\praw\models\reddit\base.py", line 31, in __getattr__
      self._fetch()
    File "D:\Programming\Phyton\lib\site-packages\praw\models\reddit\base.py", line 66, in _fetch
      params=self._info_params)
    File "D:\Programming\Phyton\lib\site-packages\praw\reddit.py", line 367, in get
      data = self.request('GET', path, params=params)
    File "D:\Programming\Phyton\lib\site-packages\praw\reddit.py", line 451, in request
      params=params)
    File "D:\Programming\Phyton\lib\site-packages\prawcore\sessions.py", line 174, in request
      params=params, url=url)
    File "D:\Programming\Phyton\lib\site-packages\prawcore\sessions.py", line 108, in _request_with_retries
      data, files, json, method, params, retries, url)
    File "D:\Programming\Phyton\lib\site-packages\prawcore\sessions.py", line 93, in _make_request
      params=params)
    File "D:\Programming\Phyton\lib\site-packages\prawcore\rate_limit.py", line 32, in call
      kwargs['headers'] = set_header_callback()
    File "D:\Programming\Phyton\lib\site-packages\prawcore\sessions.py", line 134, in _set_header_callback
      self._authorizer.refresh()
    File "D:\Programming\Phyton\lib\site-packages\prawcore\auth.py", line 328, in refresh
      password=self._password)
    File "D:\Programming\Phyton\lib\site-packages\prawcore\auth.py", line 142, in _request_token
      payload.get('error_description'))
  prawcore.exceptions.OAuthException: invalid_grant error processing request
  </code></pre>