Browse Source

should fix roll expression passing and config stuff (#14)

* should fix only part of expression being passed

* Fixed python 3.6 detection and the error for when its not there

* added saving the config at end of setup

* added youtube_dl to requirements and -U to pip install
tags/v2.0.0
Terra Barber 6 years ago
parent
commit
44c4d1fad7
3 changed files with 9 additions and 5 deletions
  1. +2
    -1
      requirements.txt
  2. +1
    -1
      roxbot/cogs/fun.py
  3. +6
    -3
      setup.py

+ 2
- 1
requirements.txt View File

@@ -3,4 +3,5 @@ aiohttp<2.3.0,>=2.0.0
beautifulsoup4==4.6.0
pillow==5.1.0
numpy==1.14.3
yarl<1.2
yarl<1.2
youtube_dl

+ 1
- 1
roxbot/cogs/fun.py View File

@@ -43,7 +43,7 @@ class Fun:
self.croak = {}

@bot.command() # Terra made this and it just work's but im too scared to clean it up so i hope it doesn't break
async def roll(self, ctx, expression=""):
async def roll(self, ctx, *, expression=""):
"""
Rolls a die using dice expression format.
Usage:

+ 6
- 3
setup.py View File

@@ -5,13 +5,13 @@ import configparser
# Version Checking
# Basically reject anything not 3.5 or 3.6 as those are the only versions that work.

if not sys.version_info[:2] == (3, 5) or sys.version_info[:2] == (3, 6):
print("Roxbot does not support Python {}".format(".".join(sys.version_info[:2])))
if not (sys.version_info[:2] == (3, 5) or sys.version_info[:2] == (3, 6)):
print("Roxbot does not support Python {}.{}".format(sys.version_info[0],sys.version_info[1]))
exit(0)

# Install Requirements

code = os.system("python3 -m pip install -r requirements.txt")
code = os.system("python3 -m pip install -U -r requirements.txt")
if code != 0:
print("Error occurred while installing requirements. Exiting...")
exit(1)
@@ -71,5 +71,8 @@ else:
config["Tokens"]["Imgur"] = token

print("Finished preferences.ini setup.")
with open("roxbot/settings/preferences.ini", 'w') as configfile:
config.write(configfile)

print("There are more options avaliable in the file (found at ./roxbot/settings/preferences.ini) if you want to make optional tweaks to Roxbot.")
print("Exiting...")

Loading…
Cancel
Save