Remove @ mentions
This commit is contained in:
parent
cc60315e21
commit
4a9671c958
7
bot.py
7
bot.py
|
@ -54,10 +54,17 @@ if args.input is None:
|
|||
])
|
||||
else:
|
||||
with open(args.data, 'r') as f:
|
||||
# Get a line with at least two words
|
||||
lines = f.readlines()
|
||||
line = choice(lines).split()
|
||||
while len(line) < 2:
|
||||
line = choice(lines).split()
|
||||
|
||||
# Remove mentions
|
||||
if line[0].count('@') > 1:
|
||||
line[0] = '@'.join(line[0].split('@')[0:2])
|
||||
if line[1].count('@') > 1:
|
||||
line[1] = '@'.join(line[1].split('@')[0:2])
|
||||
args.input = line[0] + ' ' + line[1]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue