2226
toxicrecker / discordutils Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
2226
When i try to run the play command from the code example of the music system, i get following errors
with a seach query
ERROR: query "crab rave": Failed to parse JSON (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')) Ignoring exception in command play: Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "c:\Users\admin\Desktop\Python Code\test.py", line 22, in play await player.queue(url, search=True) File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\DiscordUtils\Music.py", line 171, in queue song = await get_video_data(url, search, bettersearch, self.loop) File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\DiscordUtils\Music.py", line 70, in get_video_data data = data["entries"][0] TypeError: 'NoneType' object is not subscriptable
with a direct video link
ERROR: No video formats found Ignoring exception in command play: Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "c:\Users\admin\Desktop\Python Code\test.py", line 22, in play await player.queue(url, search=True) File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\DiscordUtils\Music.py", line 171, in queue song = await get_video_data(url, search, bettersearch, self.loop) File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\DiscordUtils\Music.py", line 70, in get_video_data data = data["entries"][0] TypeError: 'NoneType' object is not subscriptable
Comparing different alternatives for pagination. I saw a lower level implementation using discord components, using buttons to navigate pages (see this implementation).
I love the facilities that the Paginators here use, but using discord components would greatly enhance the user experience. As for implementation goes I would suggest to generalize the different reactions, buttons and other interactions (perhaps even commands) as "InteractionControllers" or a similar concept. And base the paginator on those controller interfaces instead of message reactions only.
Sounds like an interesting problem to tackle myself, tbh. But rn I'm more interested in adding features to my bots. So let me know if anyone else is interested.
Also allowing the developer to add before_interaction and after_interaction calls would also allow for even more use cases for this utility. For doing API calls per page for example.
Hey Toxicrecker, please can you comment on the likes and dislikes lines to bypass error.
When using the default music code in Readme I get 2 exceptions when using play(). Upates to both youtube and discord.py seem to be the issues for this.
\DiscordUtils\Music.py", line 196, in play
source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(self.music.queue[self.ctx.guild.id][0].source, **self.ffmpeg_opts))
A symptom of an exception from discord.py but it's broken the play function in Music.py.
site-packages\DiscordUtils\Music.py", line 92, in get_video_data
dislikes = data["dislike_count"]
KeyError: 'dislike_count'
Stupid youtube updates.
When A user joines the guild and the on_member_join event runs, whenever it gets to inviter = await tracker.fetch_inviter(member)
then it says Keyerror: {guild.id}
Is there something I should do or is it a problem with DiscordUtils?
I cant go to docs, and also cant go to github page via the link of pypi page
Right now, if you want to use the same command twice in a row you have to react, unreact and react again.
The bot should also wait for remove_reaction aswell.
I have the exact same code as written in the docs. Whenever I use the play command, it throws me the following error:
Unrecognized option 'reconnect'.
Error splitting the argument list: Option not found
After reading the docs, trying on my own, and constantly getting errors I decided I would try your code but it gave the same error. Whenever I use the player it says TypeError: 'NoneType' object is not subscriptable or when I use the volume command it says 'NoneType' object has no attribute 'change_volume'. I'm using python 3.8 because I had an error installing with 3.9
This isn't an "issue" but I'm trying to use a local image within a paginated embed and am striking out. I can embed an image within a non-paginated embed just fine using the following:
file = discord.File("imagename.png", filename="image.png")
embed = discord.Embed(title="foo")
embed.set_image(url="attachment://image.png")
await ctx.send(file=file, embed=embed)
But when attempting to utilize similar syntax with the paginator, it seems to not enjoy having another variable to process.
An example:
ctx.bot.loop.create_task(paginator.run(file=file, embeds=embeds))
I've tried a couple variations, but to no avail. The best I can get is either the embeds without the image or the image as an attachment (as a normal message, outside of an embed).
If anyone has any suggestions, I'm all ears
Just a quick suggestion that may be beneficial to include somewhere in the documentation or examples, that pagination requires the bot to have privileged intents enabled. I spent an hour struggling to identify the issue when pagination works in one of my bots but not the other; my fault since I'm well-aware of what privileged intents are, but it may also be useful for more less experienced developers who have little to no experience with it.
Hi there, I installed the latest version of discordUtils==1.28, discord.py==1.7.0 and python 3.8
I tried the examples and they do not print anything. also I do not get any errors in my console.
The title says it all; youtube_dl
and discord.py[voice]
are not dependencies that everyone needs. They should not be compulsory installs with this, when someone just wants to use, say the paginator or the invite tracker.
They should be made into optional installs, that users could choose to install.
Command raised an exception: KeyError: 'dislike_count'
Could you please provide an example of a command handler? I seem a bit confused.
Even if remove_reactions
is set to False
, it still tries to remove the user's reaction.
When the bot leaves and rejoins i get an error when i whant him to play a song: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.
Sometime its shows that bot is not connected to voice even after joining the voice channel.
Facing this error when using play command.
It would be really nice to have an option to skip a track and don't loose it, i guess it could make it easier to loop queues in the future
something like skip(delete=False)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.