Skip to content

leonardbot/leonard

Repository files navigation

Leonard bot Build Status

Leonard bot is a virtual assistant, who will be can create notifications, notes, search in the internet and in the maps etc.

Install and start

git clone https://github.com/sevazhidkov/leonard.git
cd leonard
pip install -r requirements.txt

After it, you need to set some environment variables that listed below.

You can start bot with running start.py script. Right now we don't support Python 2.x, bot tested on CPython 3.4.

python start.py

It will run bot with console adapter. You will see something like this:

Enter message:
Enter a comma-separated attachments(<type>_<path>):

Type your message in first line, second line leave empty. For example:

Enter message: !hello
Enter a comma-separated attachments(<type>_<path>):
BOT:  Hi!

You can test plugins for bot using console adapter. If you want to change adapter, set the adapter argument of start script. For example:

python start.py --adapter telegram

Don't forget set adapter's environment variables that listed below.

Plugins

Name Description Example Priority
hello Send hello message to user Hello, bot
!hello
5
registration Ask user's language if user sending message to the bot first time 1000

Environment variables

Variables sorted by priority: from high to low.

Name Description Default value
LEONARD_MONGODB_URI URI for connecting MongoDB mongodb://localhost:27017
LEONARD_REDIS_HOST Host for Redis storage localhost
LEONARD_REDIS_PORT Port for Redis storage 6379
LEONARD_REDIS_DB Num of DB for Redis storage 0
LEONARD_CONSOLE_LANGUAGE Letters of language that console adapter uses as default en
LEONARD_TELEGRAM_TOKEN Token for connection to Telegram Bot API (telegram adapter)
LEONARD_BOTAN_TOKEN Token for message analytics
LEONARD_FORECAST_IO_TOKEN Token for getting weather data from Forecast.io

Contributing

  • You can create new plugins or extend existing plugins. You can find examples of plugins code in plugins/hello.py. All hooks you can see in leonard/hooks.py. If you created new plugin don't forget to add it to installed_plugins.txt.

  • You can new adapters or improve existing adapters. You can see example adapter in adapters/console.py. All adapters functions and classes are listed in leonard/adapter.py.

  • You can improve Leonard core. At the moment, the most important thing is more effective working with threads.

  • You can translate Leonard to your language. Checkout messages folder and leonard/messages.py.

Contact

Send me a message in Telegram: @sevazhidkov.

Or in Twitter: @sevazhidkov.

Or E-mail: seva@leonardbot.xyz.

Also you can buy me coffee, pizza, new Macbook Pro or whatever you want.

About

Your virtual assistant in messengers written on Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages