Documentation
This commit is contained in:
@@ -7,7 +7,7 @@ __author__ = "Davide Testa"
|
||||
__email__ = "davide@davte.it"
|
||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||
__license__ = "GNU General Public License v3.0"
|
||||
__version__ = "2.0"
|
||||
__version__ = "2.0.1"
|
||||
__maintainer__ = "Davide Testa"
|
||||
__contact__ = "t.me/davte"
|
||||
|
||||
|
@@ -2,6 +2,29 @@
|
||||
|
||||
camelCase methods mirror API directly, while snake_case ones act as middlewares
|
||||
someway.
|
||||
|
||||
Usage
|
||||
```
|
||||
import sys
|
||||
from davtelepot.bot import Bot
|
||||
from data.passwords import my_token, my_other_token
|
||||
|
||||
long_polling_bot = Bot(token=my_token, database_url='my_db')
|
||||
webhook_bot = Bot(token=my_other_token, hostname='example.com',
|
||||
certificate='path/to/certificate.pem',
|
||||
database_url='my_other_db')
|
||||
|
||||
@long_polling_bot.command('/foo')
|
||||
async def foo_command(bot, update, user_record):
|
||||
return "Bar!"
|
||||
|
||||
@webhook_bot.command('/bar')
|
||||
async def bar_command(bot, update, user_record):
|
||||
return "Foo!"
|
||||
|
||||
exit_state = Bot.run()
|
||||
sys.exit(exit_state)
|
||||
```
|
||||
"""
|
||||
|
||||
# Standard library modules
|
||||
|
Reference in New Issue
Block a user