Update app.py
Browse files
app.py
CHANGED
|
@@ -226,32 +226,6 @@ def initialize_requests():
|
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
-
# Хранилище для кода
|
| 230 |
-
code_storage = {}
|
| 231 |
-
|
| 232 |
-
def execute_code(update: Update, context: CallbackContext) -> None:
|
| 233 |
-
command = update.message.text.split()[0]
|
| 234 |
-
if command in code_storage:
|
| 235 |
-
exec(code_storage[command])
|
| 236 |
-
|
| 237 |
-
@app.route('/webhook', methods=['POST'])
|
| 238 |
-
def webhook():
|
| 239 |
-
update = Update.de_json(request.get_json(force=True), bot)
|
| 240 |
-
dispatcher.process_update(update)
|
| 241 |
-
return jsonify(ok=True)
|
| 242 |
-
|
| 243 |
-
@app.route('/execute', methods=['POST'])
|
| 244 |
-
def execute():
|
| 245 |
-
data = request.json
|
| 246 |
-
command = data['command']
|
| 247 |
-
code = data['code']
|
| 248 |
-
code_storage[command] = code
|
| 249 |
-
return jsonify(ok=True)
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
|
| 256 |
|
| 257 |
|
|
|
|
| 226 |
|
| 227 |
|
| 228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
|
| 230 |
|
| 231 |
|