Skip to content
This repository was archived by the owner on Sep 16, 2020. It is now read-only.

Yarn did things#5

Open
Yarn wants to merge 11 commits intobyronvanstien:masterfrom
Yarn:master
Open

Yarn did things#5
Yarn wants to merge 11 commits intobyronvanstien:masterfrom
Yarn:master

Conversation

@Yarn
Copy link
Collaborator

@Yarn Yarn commented Jun 12, 2018

breaking change but for literally everything

@byronvanstien byronvanstien mentioned this pull request Jun 12, 2018
Copy link
Owner

@byronvanstien byronvanstien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: I forgot how GitHub reviews work

# Docs
Targets python >3.5

This project: https://github.com/Yarn/Listen
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change pls


## Install
```bash
pip install git+https://github.com/Yarn/Listen.git
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also change

else:
print(msg.raw)

cl = listen.client.Client()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be imported from listen.Client() more pythonic, imo

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

you can get updates for kpop by setting `kpop=True`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enumeration pls


# Support

Ping Nyar#3343 in the #development channel on the
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding me here would be nice (Recchan#0194)


@ensure_token
async def remove_favorite(self, song_id: int) -> None:
return await self.favorite(song_id, remove=True)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is self.remove_favorite could be have a protected method like self._favorite and then change the current self.favorite to self.add_favorite (to keep naming consistency)

listen/client.py Outdated
self.ws = await websockets.connect(SOCKET_ENDPOINT)
url = self._websocket_url

self._ws = await websockets.connect(url)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use self._websocket_url directly?

listen/client.py Outdated
await self.send_ws(msg)

async def start(self):
if self._ws is None:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not self._ws

continue

wrapped_message = wrap_message(data)
await self.ws_handler(wrapped_message)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await self.ws_handler(wrap_message(data))

SONG_REQUEST = BASE_URL + "songs/request"

SOCKET_ENDPOINT = "wss://listen.moe/api/v2/socket"
LIBRARY_URL = "https://github.com/Yarn/Listen"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change pls

"User-Agent": "Listen (https://github.com/GetRektByMe/Listen)",
"Content-Type": "application/json"
self._headers: Dict[str, str] = {
"User-Agent": "Listen (https://github.com/Yarn/Listen)",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change pls

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants