Places where my work lives
Ways to contact me
- Formal via email [email protected]
- Hangout on Telegram or Discord
My Site aahnik.dev
A telegram bot that runs python code. Evaluate pythonic expressions on the go, right from your chat.
License: MIT License
Places where my work lives
Ways to contact me
My Site aahnik.dev
Thank you, @gabrielesilinic for pointing this out. I am creating this issue on Github, for future reference.
This issue has been currently resolved by banning exec #4
Currently the log messages are in the server time, display them in deployers desired time zone
I have rewritten the bot and made it work in an asynchronous fashion. Currently (v0.1.0), the bot uses aiogram
.
The bot is working fine when it is run via polling
. I have tested the bot via polling mode both locally โ๏ธ and on Heroku โ๏ธ
The start.py
is the script to start the bot. You must have an environment variable named BOT_API_TOKEN
. The value of this should be equal to the token you obtained from @BotFather.
Tip: Instead of setting the env variable you may create a file
token.txt
in the root of the project, with the value of the token.
To start the bot via polling simply run the script start.py
.
You have to set some additional environment variables:
APP_NAME = subdomain ( the name of your Heroku project )
DOMAIN = domain ( like herokuapp
)
( your URL will be https://{APP_NAME}.{DOMAIN}.com )
METHOD = 'webhook' ( start.py will start webhook, if this env variable is present )
While starting the bot via webhook, no errors are being shown, but the bot is not responding. For setting up webhook, I have followed this example given in the official repo of aiogram
Work in Progress for a Major update:
Using asynchronous code.
No PRs to be accepted till this issue is closed.
bot got hanged...
Why is the timeout restriction of 10 s not working? no, that should not happen as I have code to handle that
stdout, stderr = proc.communicate(timeout=10)
is output too long ?? But I have
if len(returned_val) > 2000:
returned_val = returned_val[:2000]
returned_val += '\n\n ๐ Output was too long, truncated to 2000 characters'
Investigate the cause of the problem.
First of all click on the deploy to Heroku button given in readme.
fill-up the form that appears, and click "deploy"
and voila! its deployed.
Rextester now requires API TOKEN to use its API.
Bot no longer doing the main thing it is supposed to do.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.