Improve filters
This commit is contained in:
parent
da6efccf86
commit
5509264136
28
t0sig.py
28
t0sig.py
|
@ -67,6 +67,24 @@ async def new_message(event):
|
||||||
await event.reply('Entry added to t0.vc/g')
|
await event.reply('Entry added to t0.vc/g')
|
||||||
logging.info('Added: {}'.format(data))
|
logging.info('Added: {}'.format(data))
|
||||||
|
|
||||||
|
async def message_tanner(name, website, message, mid):
|
||||||
|
if 'sex' in message or 'porn' in message:
|
||||||
|
return
|
||||||
|
|
||||||
|
if 'lasertest' in name:
|
||||||
|
return
|
||||||
|
|
||||||
|
if 'slkjfdf.net' in website:
|
||||||
|
return
|
||||||
|
|
||||||
|
report = 'Name: {}\n\nWebsite: {}\n\nMessage: {}\n\n/allow_{}'
|
||||||
|
try:
|
||||||
|
await bot.send_message(TANNER, message=report.format(name, website, message, mid))
|
||||||
|
except:
|
||||||
|
logging.error('Problem sending bot message.')
|
||||||
|
controller_message('t0sig: problem sending bot message!')
|
||||||
|
exit()
|
||||||
|
|
||||||
|
|
||||||
async def submit(request):
|
async def submit(request):
|
||||||
data = dict(await request.post())
|
data = dict(await request.post())
|
||||||
|
@ -91,14 +109,8 @@ async def submit(request):
|
||||||
if len(message) > 1000:
|
if len(message) > 1000:
|
||||||
raise web.HTTPBadRequest(reason='Message is too long.')
|
raise web.HTTPBadRequest(reason='Message is too long.')
|
||||||
|
|
||||||
if 'sex' not in message and 'porn' not in message:
|
await message_tanner(name, website, message, mid)
|
||||||
report = 'Name: {}\n\nWebsite: {}\n\nMessage: {}\n\n/allow_{}'
|
|
||||||
try:
|
|
||||||
await bot.send_message(TANNER, message=report.format(name, website, message, mid))
|
|
||||||
except:
|
|
||||||
logging.error('Problem sending bot message.')
|
|
||||||
controller_message('t0sig: problem sending bot message!')
|
|
||||||
exit()
|
|
||||||
messages[mid] = data
|
messages[mid] = data
|
||||||
|
|
||||||
with open('data/messages.log', 'a') as f:
|
with open('data/messages.log', 'a') as f:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user