Skip to content

zaheerm/aiociscospark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aiociscospark

info:Asyncio based sdk for Cisco Spark

Installation

pip install aiociscospark

Usage

import asyncio

from aiociscospark import people

TOKEN = 'xxxxx'

async def main():
    spark = people.People(TOKEN)
    me = await spark.me()
    print(me)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Creating a bot

import os
import asyncio
from aiociscospark.bot import CommandBot, botcommand


class UselessBot(CommandBot):
    @botcommand
    async def useless(self, _):
        """
        Pretty much useless
        Usage: useless
        """
        return "I am useless"


if __name__ == '__main__':
      access_token = os.environ["TOKEN"]
      url = os.environ["BASE_URL"]
      loop = asyncio.get_event_loop()
      bot = UselessBot(access_token, url, loop)
      bot.run_server(8080)

About

Asyncio based SDK for Cisco Spark

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages