Skip to content

Commit

Permalink
Beta 5 update (#5)
Browse files Browse the repository at this point in the history
* Beta-5

* Fixed some issues and mispellings
* Added /admin command to know the status
* Register users in a database
* Users now have multiple language choices and changeability of it's language in database
* Inline mode deactivated until the real database is ready

* Delete DE.py

* Delete ES.py

* Delete PT.py

* Delete RU.py

* Delete EN.txt
  • Loading branch information
halkliff authored Jan 13, 2017
1 parent 77bc97e commit e7ba765
Show file tree
Hide file tree
Showing 14 changed files with 1,154 additions and 81 deletions.
8 changes: 5 additions & 3 deletions API/Img.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,22 +333,24 @@ def yuri():

return all

def query(tag):
def Query(tag):

y = tag.split().replace(':', '%3A')
l = Requests(username=acc.username, password_hash=acc.password_hash, site_name='yandere',
api_name='posts_list', param='search')

_url = '{site_url}{api_name}{login}{password}{param}{tags}{limit}'

url = _url.format(site_url=l.site_url, api_name=l.api_name, login=l.username,
password=l.password_hash, param=l.param, tags=tag,
password=l.password_hash, param=l.param, tags=y,
limit=PARAMS['tag_limit'])

req = requests.get(url)

ret = req.json()
quantity = len(ret)
if quantity == 0:
return "Nobody here but chickens!"
return None
else:
rnum = random.sample(range(0, quantity), 1)
num = rnum[0]
Expand Down
Binary file modified API/__pycache__/Img.cpython-35.pyc
Binary file not shown.
Binary file added API/__pycache__/acc_setup.cpython-35.pyc
Binary file not shown.
28 changes: 28 additions & 0 deletions API/data/tag_db.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- utf-8 -*-
# Tag database code

import random
from tinydb import Query, TinyDB
import requests
from API import Img

def grabber():
l = Img.Requests(site_name='yandere', api_name='tags_list', param='limit')

random_page = random.sample(range(1, 64075), 1)
random_page_number = random_page[0]
url = '{site_url}{api_name}{param}{page}'.format(site_url=l.site_url, api_name=l.api_name, login=l.username,
password=l.password_hash, param=l.param,
page='&page='+str(int(random_page_number)))

req = requests.get(url)

ret = req.json()
db = TinyDB('db.json')
db.insert(ret[0])

while True:
try:
grabber()
except:
print("Error")
10 changes: 7 additions & 3 deletions Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

"""
TOKEN: Access token given to you by @BotFather (https://telegram.me/BotFather
MASTER_ID: Your actual User Unique Indentifier, looks like: 00123001023, you can look yours
at https://telegram.me/userinforobot
BOT_NAME: change this to customize your bot's name. I.e.: "Cyka Bot"
BOT_ID: change this to insert your bot's id (i.e.: Cyka_bot) NOTE: DON'T USE THE ~@~ OTHERWISE THE BOT
WORK PROPERLY!!!
"""
TOKEN = 'Put your token here within the single quote'
BOT_NAME = 'Rename me to change your bot name!'
BOT_ID = 'Rename here with your bot ID, without the ~@~'
# 'Emα' 'Put your token here within the single quote' 'Rename me to change your bot name!' 'Rename here with your bot ID, without the ~@~'
TOKEN = '327068957:AAGvW-4w53Qo-ilN4dnoXy2-mlQ1UFOUhPg'
MASTER_ID = '123956344'
BOT_NAME = 'Emα'
BOT_ID = 'EmaBETA_bot'
Loading

0 comments on commit e7ba765

Please sign in to comment.