mirror of
https://github.com/house-of-vanity/fesmoo_perdoliq.git
synced 2025-07-06 21:54:07 +00:00
Add Ci procedure
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 56 KiB |
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM ubuntu:18.04
|
||||
RUN apt-get update && \
|
||||
apt-get install -y python3 python3-pip && \
|
||||
pip3 install python-telegram-bot && \
|
||||
pip3 install requests && \
|
||||
pip3 install beautifulsoup4 && \
|
||||
|
||||
WORKDIR /usr/share/fesmoo_perdoliq
|
||||
COPY ./*py /usr/share/fesmoo_perdoliq/
|
||||
CMD python3 baraban.py
|
||||
|
13
baraban.py
13
baraban.py
@ -6,16 +6,17 @@ on the telegram.ext bot framework.
|
||||
This program is dedicated to the public domain under the CC0 license.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
import threading
|
||||
import telegram
|
||||
from telegram.error import NetworkError, Unauthorized
|
||||
from time import sleep
|
||||
try:
|
||||
import tg_settings
|
||||
TOKEN = os.environ["TG_TOKEN"]
|
||||
except:
|
||||
print("You have to create tg_settings.py. See tg_settings.py.example.")
|
||||
os.exit(1)
|
||||
print("You have to set env var TG_TOKEN with bot token.")
|
||||
sys.exit(1)
|
||||
try:
|
||||
if os.environ["DRYRUN"]:
|
||||
from dryrun import Perdoliq
|
||||
@ -29,7 +30,6 @@ def main():
|
||||
"""Run the bot."""
|
||||
global update_id
|
||||
# Telegram Bot Authorization Token
|
||||
TOKEN = tg_settings.TG_TOKEN
|
||||
bot = telegram.Bot(TOKEN)
|
||||
|
||||
# get the first pending update_id,
|
||||
@ -102,7 +102,10 @@ def do_action(update):
|
||||
"chosen subj %s "\
|
||||
"test %s and accuracy %s" % (s[3], s[4], s[5])
|
||||
update.message.reply_text(msg)
|
||||
update.message.reply_photo(open('1516736368795.png', 'rb'))
|
||||
update.message.reply_text("You cannot resolve more than "\
|
||||
"one test in the same time."\
|
||||
"Одновременно решать более одного теста невозможно,"\
|
||||
" вы испортите результаты обоих тестов.")
|
||||
perdoliq(s[1], s[2], s[3], s[4], s[5], s[6])
|
||||
update.message.reply_text("It's done. Check your test because "\
|
||||
"i disclaim any responsibility.")
|
||||
|
Reference in New Issue
Block a user