Compare commits
6 Commits
7eba92016e
...
master
Author | SHA1 | Date | |
---|---|---|---|
2f2bc581d4 | |||
61225ebd20 | |||
7943e291fb | |||
9220022d3e | |||
5509264136 | |||
da6efccf86 |
2143
index.html.bak
Normal file
2143
index.html.bak
Normal file
File diff suppressed because it is too large
Load Diff
17
requirements.txt
Normal file
17
requirements.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
aiohttp==3.6.3
|
||||
async-timeout==3.0.1
|
||||
attrs==21.2.0
|
||||
certifi==2021.10.8
|
||||
chardet==3.0.4
|
||||
idna==2.10
|
||||
idna-ssl==1.1.0
|
||||
multidict==4.7.6
|
||||
pkg-resources==0.0.0
|
||||
pyaes==1.6.1
|
||||
pyasn1==0.4.8
|
||||
requests==2.25.1
|
||||
rsa==4.7.2
|
||||
Telethon==1.23.0
|
||||
typing-extensions==3.10.0.0
|
||||
urllib3==1.26.8
|
||||
yarl==1.5.1
|
2120
reversed.txt
Normal file
2120
reversed.txt
Normal file
File diff suppressed because it is too large
Load Diff
43
t0sig.py
43
t0sig.py
@@ -46,27 +46,50 @@ async def new_message(event):
|
||||
await event.reply('Message ID not found. Did the bot restart?')
|
||||
return
|
||||
|
||||
entry = '------------------------------------------------------------\n\n{} - {}'.format(data['date'], data['name'])
|
||||
entry = '\n\n{} - {}'.format(data['date'], data['name'])
|
||||
|
||||
website = data['website']
|
||||
if website:
|
||||
prefixes = ['http://', 'https://', 'gemini://', 'gopher://']
|
||||
for prefix in prefixes:
|
||||
if website.startswith(prefix):
|
||||
if website.lower().startswith(prefix):
|
||||
break
|
||||
else: # for loop
|
||||
website = 'http://' + website
|
||||
|
||||
entry += ' (<a href="{0}" target="_blank" rel="noreferrer noopener">{0}</a>)'.format(website)
|
||||
|
||||
entry += '\n\n{}\n\n'.format(data['message'])
|
||||
entry += '\n\n{}\n\n------------------------------------------------------------'.format(data['message'])
|
||||
|
||||
with open('data/g/index.html', 'a') as f:
|
||||
with open('data/g/index.html', 'r') as f:
|
||||
page = f.read()
|
||||
|
||||
with open('data/g/index.html', 'w') as f:
|
||||
header, entries = page.split('===========', maxsplit=1)
|
||||
|
||||
f.write(header)
|
||||
f.write('===========')
|
||||
f.write(entry)
|
||||
f.write(entries)
|
||||
|
||||
await event.reply('Entry added to t0.vc/g')
|
||||
logging.info('Added: {}'.format(data))
|
||||
|
||||
async def message_tanner(name, website, message, captcha, mid):
|
||||
if 'tanner' not in captcha.lower():
|
||||
return
|
||||
|
||||
if name.replace(' ', '') in ['website', 'webpage', 'homepage']:
|
||||
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):
|
||||
data = dict(await request.post())
|
||||
@@ -75,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.')
|
||||
|
||||
@@ -91,14 +116,8 @@ async def submit(request):
|
||||
if len(message) > 1000:
|
||||
raise web.HTTPBadRequest(reason='Message is too long.')
|
||||
|
||||
if 'sex' not in message and 'porn' not in message:
|
||||
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()
|
||||
await message_tanner(name, website, message, captcha, mid)
|
||||
|
||||
messages[mid] = data
|
||||
|
||||
with open('data/messages.log', 'a') as f:
|
||||
|
Reference in New Issue
Block a user