Skip to main content

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

MIT License

Project details


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.12.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

Kickbase_Bot-0.0.12-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file Kickbase_Bot-0.0.12.tar.gz.

File metadata

  • Download URL: Kickbase_Bot-0.0.12.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for Kickbase_Bot-0.0.12.tar.gz
Algorithm Hash digest
SHA256 21b7157e9c1e2e7b769b8141dd0be544566ed24c5bc4497e1e679e96990f6b5b
MD5 de684d022564a8be781265755ae92670
BLAKE2b-256 989eda453c554d44426973af2e2edf41ad9273aa20804a4bc0a312430890bd6f

See more details on using hashes here.

File details

Details for the file Kickbase_Bot-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: Kickbase_Bot-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for Kickbase_Bot-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1e3b8095927c62df589ba0cef7d5b5f41d71aba15c9ed4417d4095586b0fa51e
MD5 6d51ee1acbc801b724487b25fb589492
BLAKE2b-256 f3329da7d69967e773b947d6f428241d8d92169f1dffb26e25b98f62b7e54039

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page