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 into
byronvanstien:masterfrom
Yarn:master
Open

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

Conversation

@Yarn

@Yarn Yarn commented Jun 12, 2018

Copy link
Copy Markdown
Collaborator

breaking change but for literally everything

@byronvanstien byronvanstien mentioned this pull request Jun 12, 2018

@byronvanstien byronvanstien left a comment

Copy link
Copy Markdown
Owner

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

Comment thread README.md
# Docs
Targets python >3.5

This project: https://github.com/Yarn/Listen

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Change pls

Comment thread README.md

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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also change

Comment thread README.md
else:
print(msg.raw)

cl = listen.client.Client()

Copy link
Copy Markdown
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

Comment thread README.md
cl.loop.create_task(cl.start())
```

you can get updates for kpop by setting `kpop=True`

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Enumeration pls

Comment thread README.md

# Support

Ping Nyar#3343 in the #development channel on the

Copy link
Copy Markdown
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)

Comment thread listen/client.py

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

Copy link
Copy Markdown
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)

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

self._ws = await websockets.connect(url)

Copy link
Copy Markdown
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?

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

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

Copy link
Copy Markdown
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

Comment thread listen/client.py
continue

wrapped_message = wrap_message(data)
await self.ws_handler(wrapped_message)

Copy link
Copy Markdown
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))

Comment thread listen/constants.py
SONG_REQUEST = BASE_URL + "songs/request"

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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Change pls

Comment thread listen/client.py
"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
Copy Markdown
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