Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. volume = min(60, max(30, volume))
  2.  
  3. volume = min(configParser.get('config_searchandplay', 'volume_max'), max(configParser.get('config_searchandplay', 'volume_min'), volume)) #Max Volume Spam Protection
  4.  
  5. [config_searchandplay]
  6. #Volume Protection
  7. volume_max = 90
  8. volume_min = 10
  9.  
  10. vol_max = int(configParser.get('config_searchandplay', 'volume_max'))
  11. vol_min = int(configParser.get('config_searchandplay', 'volume_min'))
  12. volume = min(vol_max, max(vol_min, volume))
  13.  
  14. vol_max = configParser.getint('config_searchandplay', 'volume_max')
  15. vol_min = configParser.getint('config_searchandplay', 'volume_min')
  16.  
  17. >>> min(u'90',u'10')
  18. u'10'
  19.  
  20. >>> min(u'9',u'10')
  21. u'10'
  22.  
  23. >>> min(int(u'9'),(u'90'))
  24. 9
  25.  
  26. ConfigParser.getint(section, option)
  27.  
  28. volume = min(configParser.getint('config_searchandplay', 'volume_max'), max(configParser.getint('config_searchandplay', 'volume_min'), volume)) #Max Volume Spam Protection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement