title: Discord.py music bot, using a text file to save volume integer but I get ValueError: invalid literal for int() with base 10: ''
body: <p>I've been trying to make a Discord.py bot. While modifying some of the base code for the music portion to store the volume in a text file(so it's consistent everytime it plays a new song) and I ran into some problems. </p>
  
  <pre><code>ValueError: invalid literal for int() with base 10: ''
  </code></pre>
  
  <p>Here's my code for the relevant portion:</p>
  
  <pre><code>@commands.command(pass_context=True, no_pm=True)
      async def volume(self, ctx, value: int):
          """Sets the volume of the currently playing song."""
  
          state = self.get_voice_state(ctx.message.server)
          with open(r'E:\PythonProjects\WeebBot\textfiles\volumefile.txt', 'r+') as volumefile:
              open(r'E:\PythonProjects\WeebBot\textfiles\volumefile.txt', 'w')
              volumefile.write(str(value))
              if state.is_playing():
                  read_data = volumefile.read()
                  player = state.player
                  player.volume = int(read_data.rstrip('\n')) / 100
                  await self.bot.say('Set the volume to {:.0%}'.format(player.volume))
          volumefile.close()
  </code></pre>
  
  <p>I've tried using floats (player.volume uses 0.1 to 2.0 as values for volume from 1% to 200%) and I think I also delete any \n chars that might show up at the end of the file. I'm only reading ints all bunched up so I don't believe I need to do anything else?</p>