|
|
|
|
|
|
|
|
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: |