So quantumutils is my first attempt at making a library that everyone can use, and it includes several of the utilities that I use to make my bot.
python -m pip install quantumutils
- Basic functions
- tdm()
- find()
- getjson()
- Some better utilities
- Pages
- FieldPages
- A sample HelpPaginator
- SimplePaginator
Some sample code outlining some of the functions of my bot.
importquantumutilsprint([iforiinquantumutils.find("Lorem","Lorem Ipsum Lorem")])
>>> [0,12]
print(awaitquantumutils.getjson("www.randomjsonreturner.com"))
>>> {
"some":{
"structured":"JSON",
"result":"returned",
"as","a"
},
"dictionary":"."
}
#discordbotapp.pyimportquantumutilsimportdiscordfromdiscord.extimportcommandsbot=commands.Bot(prefix=".",description="A sample bot")
@bot.command()asyncdefpaginatedcommand(ctx):
embeds=[discord.Embed(title="One",description="1"),discord.Embed(title="Two",description="2"),discord.Embed(title="Three",description="3")]
awaitquantumutils.SimplePaginator(extras=embeds).paginate(ctx)Quite a bit of the code in the module are from other external sources, which I copied (and modified to add some of my own effort). I understand that I should not be doing this technically. But, I find it useful if all those scattered utilities are compiled into one utility module, plus some of my own utilities, then everyone can use.