Add captcha
This commit is contained in:
parent
61225ebd20
commit
2f2bc581d4
14
t0sig.py
14
t0sig.py
|
@ -75,14 +75,8 @@ async def new_message(event):
|
|||
await event.reply('Entry added to t0.vc/g')
|
||||
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 or 'porn' in name:
|
||||
return
|
||||
|
||||
if 'slkjfdf.net' in website:
|
||||
async def message_tanner(name, website, message, captcha, mid):
|
||||
if 'tanner' not in captcha.lower():
|
||||
return
|
||||
|
||||
if name.replace(' ', '') in ['website', 'webpage', 'homepage']:
|
||||
|
@ -104,9 +98,11 @@ async def submit(request):
|
|||
logging.info('{} {}'.format(mid, data))
|
||||
|
||||
try:
|
||||
fake_username = data.get('fake_username', '') # not used yet
|
||||
name = data['name']
|
||||
website = data.get('website', '')
|
||||
message = data['message']
|
||||
captcha = data.get('captcha', '')
|
||||
except KeyError:
|
||||
raise web.HTTPBadRequest(reason='You are missing something.')
|
||||
|
||||
|
@ -120,7 +116,7 @@ async def submit(request):
|
|||
if len(message) > 1000:
|
||||
raise web.HTTPBadRequest(reason='Message is too long.')
|
||||
|
||||
await message_tanner(name, website, message, mid)
|
||||
await message_tanner(name, website, message, captcha, mid)
|
||||
|
||||
messages[mid] = data
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user