Closed SinanAkkoyun closed 2 years ago
Its also very bad py
💀
I would suggest using discord.ext.commands.Bot
instead of subclassing discord.Client
, it has better everything, you can view the differences here and here.
I'll try your code and will reply with a CR/CNR, will be using fba0cc61199ebacfe2d8dece68b5c21ee4f5c41b.
I get another error then but at least this one is gone
If it's related to this issue in any way, please include a full traceback.
voice_client.py line 256 my fix:
Consider making a pull request if you're sure it's functional.
Thank you so much!!!
Here is the full traceback:
Traceback (most recent call last):
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 334, in _run_event
await coro(*args, **kwargs)
File "X:\py\main.py", line 29, in on_message
vc.play(source, after=lambda e: print(f'Player error: {e}') if e else None)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\voice_client.py", line 849, in play
return self.player.play(source, after=after)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\voice_client.py", line 314, in play
self._player = AudioPlayer(source, self, after=after)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\player.py", line 630, in __init__
self._connected: threading.Event = client._connected
AttributeError: 'Player' object has no attribute '_connected'
Also, ext is not defined for me, do I need to install rebase somehow differently/what is the correct way?
Hm, if you'd test my sample code anyways I would love to know if voice playback and rec does work for you! I am a py beginner and have the suspicion that I badly messed somewhere up when setting everything up
Thanks again :)
I tried the music bot example and this happened:
Traceback (most recent call last):
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 334, in _run_event
await coro(*args, **kwargs)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 1024, in on_message
await self.process_commands(message)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 1021, in process_commands
await self.invoke(ctx)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 984, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 886, in invoke
await self.prepare(ctx)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 822, in prepare
await self.call_before_hooks(ctx)
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 760, in call_before_hooks
await self._before_invoke(instance, ctx) # type: ignore
File "X:\py\musicbot.py", line 123, in ensure_voice
elif ctx.voice_client.is_playing():
AttributeError: 'VoiceClient' object has no attribute 'is_playing'
When I set the self._connected to a new threading.Event() and call set() immediately after that in init in player.py, I get this error:
Traceback (most recent call last):
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\player.py", line 674, in run
self._do_run()
File "C:\Users\x\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\player.py", line 642, in _do_run
play_audio = self.client.send_audio_packet
AttributeError: 'Player' object has no attribute 'send_audio_packet'
I might've slightly broken voice stuff while working on voice receive. Oops!
I might've slightly broken voice stuff while working on voice receive. Oops!
Oh, well :D I was almost going crazy thinking I messed up Is there a way for me to get a working version of your nice lib running or do I have to wait? :)
Is there a way for me to get a working version of your nice lib running or do I have to wait? :)
Your best bet is to watch
this repository (near the star button, top right) to receive notifications (email) on repo updates (I think).
Also, ext is not defined for me, do I need to install rebase somehow differently/what is the correct way?
That's... peculiar. I usually git clone --single-branch -b rebase https://github.com/dolfies/discord.py-self
, and do mv discord.py-self/discord . && rm -r discord.py-self
. That way, I have a copy of discord.py-self as a folder, and if I need to make any changes, I can do so without too much hassle (going into site-packages).
Fixed in latest commit.
no way, I will try it, thank you so much!!!!!!!!!
Hi, now I get this error : Player error: send_audio_packet() got an unexpected keyword argument 'encode'
@SinanAkkoyun Did you ever get this working and if so could you share with me how you did?
Summary
Idk python, but I needed to fix an error (i think it was unintended but idk py)
Reproduction Steps
Just follow the code and install discord.py at rebase branch
Code
Expected Results
should work
Actual Results
doesnt:
System Information
well, I installed the rebase by cloning it and then running python3 -m pip install .
python -m discord -v C:\Python310\python.exe: No module named discord.main; 'discord' is a package and cannot be directly executed
Checklist
Additional Information
voice_client.py line 256 my fix:
I get another error then but at least this one is gone Its also very bad py