Package: new-DisUtils
DiscordUtilsA very useful library made to be used in withpycordInstallationFor access to Pagination and InviteTracker use:pip install new-DisUtilsor, instead use the following for access to Music functions aswellpip install new-DisUtils[voice]Requires py-cord[voice] so make sure you have all dependencies of it installed.Example codeDisUtils.Pagination.AutoEmbedPaginator@bot.command()asyncdefpaginate(ctx):embed1=discord.Embed(color=ctx.author.color).add_field(name="Example",value="Page 1")embed2=discord.Embed(color=ctx.author.color).add_field(name="Example",value="Page 2")embed3=discord.Embed(color=ctx.author.color).add_field(name="Example",value="Page 3")paginator=DiscordUtils.Pagination.AutoEmbedPaginator(ctx)embeds=[embed1,embed2,embed3]awaitpaginator.run(embeds)DiscordUtils.Pagination.CustomEmbedPaginator@bot.command()asyncdefpaginate(ctx):embed1=discord.Embed(color=ctx.author.color).add_field(name="Example",value="Page 1")embed2=discord.Embed(color=ctx.author.color).add_field(name="Example",value="Page 2")embed3=discord.Embed(color=ctx.author.color).add_field(name="Example",value="Page 3")paginator=DiscordUtils.Pagination.CustomEmbedPaginator(ctx)paginator.add_reaction('⏮️',"first")paginator.add_reaction('⏪',"back")paginator.add_reaction('🔐',"lock")paginator.add_reaction('⏩',"next")paginator.add_reaction('⏭️',"last")embeds=[embed1,embed2,embed3]awaitpaginator.run(embeds)DiscordUtils.InviteTrackerimportdiscordfromdiscord.extimportcommandsimportDiscordUtilsintents=discord.intents.default()intents.members=Truebot=commands.AutoShardedBot(command_prefix=">",intents=intents)tracker=DiscordUtils.InviteTracker(bot)@bot.eventasyncdefon_member_join(member):inviter=awaittracker.fetch_inviter(member)# inviter is the member who invitedDiscordUtils.Musicimportdiscordfromdiscord.extimportcommandsimportDiscordUtilsbot=commands.AutoShardedBot(command_prefix=">")music=DiscordUtils.Music()@bot.command()asyncdefjoin(ctx):awaitctx.author.voice.channel.connect()#Joins author's voice channel@bot.command()asyncdefleave(ctx):awaitctx.voice_client.disconnect()@bot.command()asyncdefplay(ctx,*,url):player=music.get_player(guild_id=ctx.guild.id)ifnotplayer:player=music.create_player(ctx,ffmpeg_error_betterfix=True)ifnotctx.voice_client.is_playing():awaitplayer.queue(url,search=True)song=awaitplayer.play()awaitctx.send(f"Playing{song.name}")else:song=awaitplayer.queue(url,search=True)awaitctx.send(f"Queued{song.name}")@bot.command()asyncdefpause(ctx):player=music.get_player(guild_id=ctx.guild.id)song=awaitplayer.pause()awaitctx.send(f"Paused{song.name}")@bot.command()asyncdefresume(ctx):player=music.get_player(guild_id=ctx.guild.id)song=awaitplayer.resume()awaitctx.send(f"Resumed{song.name}")@bot.command()asyncdefstop(ctx):player=music.get_player(guild_id=ctx.guild.id)awaitplayer.stop()awaitctx.send("Stopped")@bot.command()asyncdefloop(ctx):player=music.get_player(guild_id=ctx.guild.id)song=awaitplayer.toggle_song_loop()ifsong.is_looping:awaitctx.send(f"Enabled loop for{song.name}")else:awaitctx.send(f"Disabled loop for{song.name}")@bot.command()asyncdefqueue(ctx):player=music.get_player(guild_id=ctx.guild.id)awaitctx.send(f"{', '.join([song.nameforsonginplayer.current_queue()])}")@bot.command()asyncdefnp(ctx):player=music.get_player(guild_id=ctx.guild.id)song=player.now_playing()awaitctx.send(song.name)@bot.command()asyncdefskip(ctx):player=music.get_player(guild_id=ctx.guild.id)data=awaitplayer.skip(force=True)iflen(data)==2:awaitctx.send(f"Skipped from{data[0].name}to{data[1].name}")else:awaitctx.send(f"Skipped{data[0].name}")@bot.command()asyncdefvolume(ctx,vol):player=music.get_player(guild_id=ctx.guild.id)song,volume=awaitplayer.change_volume(float(vol)/100)# volume should be a float between 0 to 1awaitctx.send(f"Changed volume for{song.name}to{volume*100}%")@bot.command()asyncdefremove(ctx,index):player=music.get_player(guild_id=ctx.guild.id)song=awaitplayer.remove_from_queue(int(index))awaitctx.send(f"Removed{song.name}from queue")For further information please read the docsLinksDocumentationGithubCreditsForked from toxicrecker/DiscordUtils