Browse Source

fixed blacklist command due to it moving during 1.5

tags/v1.6.1
Roxie Gibson 6 years ago
parent
commit
fcfa0d968d
2 changed files with 5 additions and 4 deletions
  1. +1
    -0
      README.md
  2. +4
    -4
      Roxbot/settings/settings.py

+ 1
- 0
README.md View File

@@ -21,6 +21,7 @@ _Coming Soon_
###### Hot Fixes
- Voice has received a number of hot fixes to make sure it works properly.
- Slowmode now doesn't effect mods and admins of that guild.
- Fixed `blacklist` command.

#### v1.6.0
###### New Features

+ 4
- 4
Roxbot/settings/settings.py View File

@@ -68,13 +68,13 @@ class Settings:
mentions.remove(user)

if option in ['+', 'add']:
with open("settings/blacklist.txt", "r") as fp:
with open("Roxbot/blacklist.txt", "r") as fp:
for user in mentions:
for line in fp.readlines():
if user.id + "\n" in line:
mentions.remove(user)

with open("settings/blacklist.txt", "a+") as fp:
with open("Roxbot/blacklist.txt", "a+") as fp:
lines = fp.readlines()
for user in mentions:
if user.id not in lines:
@@ -83,9 +83,9 @@ class Settings:
return await ctx.send('{} user(s) have been added to the blacklist'.format(blacklist_amount))

elif option in ['-', 'remove']:
with open("settings/blacklist.txt", "r") as fp:
with open("Roxbot/blacklist.txt", "r") as fp:
lines = fp.readlines()
with open("settings/blacklist.txt", "w") as fp:
with open("Roxbot/blacklist.txt", "w") as fp:
for user in mentions:
for line in lines:
if user.id + "\n" != line:

Loading…
Cancel
Save