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

###### Hot Fixes ###### Hot Fixes
- Voice has received a number of hot fixes to make sure it works properly. - 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. - Slowmode now doesn't effect mods and admins of that guild.
- Fixed `blacklist` command.


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

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

mentions.remove(user) mentions.remove(user)


if option in ['+', 'add']: 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 user in mentions:
for line in fp.readlines(): for line in fp.readlines():
if user.id + "\n" in line: if user.id + "\n" in line:
mentions.remove(user) mentions.remove(user)


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


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

Loading…
Cancel
Save