Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'coroutine' object is not callable #170

Closed
Kaz213 opened this issue Jun 22, 2022 · 15 comments
Closed

TypeError: 'coroutine' object is not callable #170

Kaz213 opened this issue Jun 22, 2022 · 15 comments
Labels
Not a Bug Label for issues that aren't bugs.

Comments

@Kaz213
Copy link

Kaz213 commented Jun 22, 2022

I'm getting this error when I try and play music on using my discord bot.

Task exception was never retrieved
future: <Task finished name='Task-32' coro=<Websocket.process_data() done, defined at C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\websocket.py:137> exception=TypeError("'coroutine' object is not callable")>
Traceback (most recent call last):
File "C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\websocket.py", line 156, in process_data
event, payload = await self._get_event_payload(data['type'], data)
File "C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\websocket.py", line 184, in get_event_payload
track = await self.node.build_track(cls=wavelink.Track, identifier=base64
)
File "C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\pool.py", line 294, in build_track
return cls(identifier, data)
TypeError: 'coroutine' object is not callable
Task exception was never retrieved
future: <Task finished name='Task-39' coro=<Websocket.process_data() done, defined at C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\websocket.py:137> exception=TypeError("'coroutine' object is not callable")>
Traceback (most recent call last):
File "C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\websocket.py", line 156, in process_data
event, payload = await self._get_event_payload(data['type'], data)
File "C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\websocket.py", line 184, in get_event_payload
track = await self.node.build_track(cls=wavelink.Track, identifier=base64
)
File "C:\Users\icep2\AppData\Local\Programs\Python\Python39\lib\site-packages\wavelink\pool.py", line 294, in build_track
return cls(identifier, data)
TypeError: 'coroutine' object is not callable

@EvieePy
Copy link
Member

EvieePy commented Jun 22, 2022

Can you please provide the full code you are using?
You can paste it here: https://mystb.in/

@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

@EvieePy I have pasted it

@EvieePy
Copy link
Member

EvieePy commented Jun 22, 2022

You need to paste it, click save and then send the link it creates

@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

would you also need the main part of my code or is the music part fine as I am only using wavelink there?

@EvieePy
Copy link
Member

EvieePy commented Jun 22, 2022

https://mystb.in/BeatlesPillJill.python#L76-77

play is a coroutine and needs to be awaited.
Also you are trying to store the returned track to a wavelink class which will break wavelink.

A few side notes:

  • You don't need to fetch the player from a node everytime you run a command, ctx.voice_client will be the Player you used to connect. Or None if it has not been connected yet.
  • You are using globals which is bad practice. These globals pollute the namespace of your whole application and cause problems.
  • wavelink.Player already has an inbuilt Queue. Which is player.queue

@EvieePy EvieePy added the Not a Bug Label for issues that aren't bugs. label Jun 22, 2022
@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

where can i find the docs for how the queue works?

@EvieePy
Copy link
Member

EvieePy commented Jun 22, 2022

https://wavelink.readthedocs.io/en/latest/wavelink.html#queues

The main uses are player.queue.put(track) [Puts a song in the players queue] and player.queue.get() [Gets a track if there is one from the queue.]

You can check if the queue is empty which if player.queue.is_empty

@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

Thank you also should I close the Issue or is that for you to do?

@EvieePy
Copy link
Member

EvieePy commented Jun 22, 2022

I will close this issue. If you need further assistance consider joining the official discord server.

@EvieePy EvieePy closed this as completed Jun 22, 2022
@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

It says the link is invalid for the discord server link that's why I went through here

@EvieePy
Copy link
Member

EvieePy commented Jun 22, 2022

I just tested it and it's still valid for me?

@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

image

@EvieePy
Copy link
Member

EvieePy commented Jun 22, 2022

What is your Discord name, have you been previously banned from the server?

@Kaz213
Copy link
Author

Kaz213 commented Jun 22, 2022

Nevermind its because i was using a VPN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not a Bug Label for issues that aren't bugs.
Projects
None yet
Development

No branches or pull requests

2 participants