Skip to content

Yarn/Listen

 
 

Repository files navigation

Listen

An API wrapper for listen.moe built upon the websockets library and aiohttp.

Targets python >3.5

This project: https://github.com/Yarn/Listen This is essentially a rewrite of https://github.com/GetRektByMe/Listen

The api provided is unstable and subject to change


Install

pip install git+https://github.com/Yarn/Listen.git

Example

import listen

async def hand(msg):
    if msg.type == listen.message.SONG_INFO:
        print(msg)
        print(msg.title)
        for x in msg.sources + msg.artists + msg.albums:
            print(" ", x)
    else:
        print(msg.raw)

cl = listen.client.Client()
# pass your loop into Client if you aren't using the event loop returned by asyncio.get_event_loop()
# cl = listen.client.Client(loop)
cl.register_handler(hand)
cl.run()

if the event loop is already running you will need to replace cl.run() with

cl.loop.create_task(cl.start())

you can get updates for kpop by setting kpop=True

cl = listen.client.Client(kpop=True)

Docs (out of date)

These are the docs for https://github.com/GetRektByMe/Listen

The api has mostly changed so most of the documentation won't be applicable to this repo

You can find our docs here

Support

Ping Nyar#3343 in the #development channel on the Listen.moe discord or open an issue if you find a bug, need a new feature or want some documentation.

About

An API wrapper for listen.moe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%