Python bot framework for kickbase
Project description
Kickbase_Bot
Kickbase bot framework for Python 3. This work is unofficial and not related to kickbase in any way. All of this was done for scientific reasons only and you should not use it for anything else but for your personal learning!
Installation
- From pypi:
pip3 install kickbase_bot
Requirements
Usage
# Press the green button in the gutter to run the script.
import logging
from kickbase_api.models.chat_item import ChatItem
from kickbase_api.models.feed_item import FeedItem, FeedType
from kickbase_bot import logger as kickbase_logger
from kickbase_bot.kickbase_bot import KickbaseBot
sh = logging.StreamHandler()
sh.setLevel(logging.DEBUG)
kickbase_logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
sh.setFormatter(formatter)
kickbase_logger.addHandler(sh)
def on_feed_item(feed_item: FeedItem, bot: KickbaseBot):
pass
def on_chat_item(chat_item: ChatItem, bot: KickbaseBot):
if chat_item.user_id != bot.kickbase_api.user.id:
print("Got chat: " + chat_item.message + " from: " + chat_item.username)
bot.kickbase_api.post_chat_message("Hey {}".format(chat_item.username), bot.selected_league)
if __name__ == '__main__':
kkbs_bot = KickbaseBot(periodic_feed_interval=5,
google_identity_toolkit_api_key="example",
mongodb_host="localhost",
mongodb_user="kkbs_bot", mongodb_password="kkbs_bot")
kkbs_bot.connect("example", "example_password")
kkbs_bot.add_feed_item_callback(on_feed_item)
kkbs_bot.add_chat_item_callback(on_chat_item)
kkbs_bot.run("example_league_id")
Docs
API
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Kickbase_Bot-0.0.11.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for Kickbase_Bot-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6221c1a3374ee2212603521a640f57f0d0dc3a469b688af7b4d1450d2bc57249 |
|
MD5 | 2709c4dc98a3f7ab90fb7f228a05d44a |
|
BLAKE2b-256 | d1c3e75a70682e2c82fc3dacbce90744e3d210d5edc762b9fcfb2a5271f1099a |