Saravanan666/pypi-org huggingface dataset:
Package: discord-ext-fslash
discord-ext-fslashThis library registers commands from discord.py command framework as slash commands in discord.py as well by doing a monkey patch.WARNINGAgain, the way this library works is a monkey patch and is not without the possibility of unexpected behavior.FeaturesIt supports both the cooldown and other decorators of the command framework and thedescribedecorator of the app command to work.The converter will automatically replace to theTransformerof slash version.It can also automatically convert invalid annotations tostrand register overnested group commands by accepting subcommands from command arguments.Even if you have too many commands and reach the maximum number of can be registered slash commands, we have a way to deal with it. (An example is below)If you are planning to create a bot, we recommend using HybridCommand, which comes standard in discord.py.Installation$ pip install discord-ext-fslashExampleNormalThe following is an example of creating a command calledpingthat works with both slash and message commands.fromdiscord.ext.fslashimportextend_force_slash...bot=extend_force_slash(commands.Bot(command_prefix="fs!",intents=intents))@bot.command()asyncdefping(ctx):awaitctx.reply("pong")Split Commands by CategoriesEven if there are too many commands in the command framework to register in the slash, it provides a way to implement them all by making only the commands in the slash subcommands of the group command.The following example creates the group commandsserver-toolandentertainmentand sets up the commands in the command framework as subcommands of those commands.fromdiscord.ext.fslashimportextend_force_slash...bot=extend_force_slash(commands.Bot(command_prefix="fs!",intents=intents),first_groups=(discord.app_commands.Group(name="server-tool"),discord.app_commands.Group(name="entertainment")))@bot.command(description="Ban member",fsparent="server-tool")@commands.has_guild_permissions(ban_members=True)@commands.bot_has_guild_permissions(ban_members=True)@commands.cooldown(1,10,commands.BucketType.guild)@discord.app_commands.describe(member="Member to be banned")asyncdefban(ctx,*,member:discord.Member):# `/server-tool ban member: ...` or `fs!ban ...` to run this command.awaitctx.typing()awaitmember.ban()awaitctx.reply("pong")@bot.command(description="Make wow",fsparent="entertainment")asyncdefwow(ctx):# `/entertainment wow` or `fs!wow` to run this command.awaitctx.reply("wow")DocumentationThere are features to improve compatibility for greater convenience.See thedocumentationfor details.ContributingIssues and PullRequests should be brief in content.The code should be similar in style to the current code.Please limit all text to 100 characters per line if possible, except for comments.For comments, please limit to 200 characters per line if possible.LicenseMIT
Package: discord-ext-games
Tic Tac ToeExampleimportdiscordfromdiscord.ext.gamesimportTicTacToefromdiscord.extimportcommandsbot=commands.Bot("!")@bot.eventasyncdefon_ready():print("Bot is Ready!")@bot.command()asyncdefttt(ctx,member:discord.Member):awaitTicTacToe(ctx,[ctx.author,member],config={'down_right':675624269073481749,'x':536043344569303041,}).start()bot.run("")
Package: discord-ext-getch
discord-ext-getchA discord.py extension that allows simplification of getting and fetching objects.Installationpython3-mpipinstall--upgradediscord-ext-getchUsagefromdiscord.ext.getchimportGetchMixinclassBot(commands.Bot,GetchMixin):...bot=Bot(command_prefix='!')@bot.eventasyncdefon_ready():print(awaitbot.annel(123456789).essage(987654321).getch())
Package: discord-ext-help
discord.ext.helpA discord.py extension that automatically generates interaction help commands based on Dict.DependencyDefxult/reactionmenudiscord.py 2.0 and laterThis library is not guaranteed to be compatible with the discord.py fork (Because the reactionmenu used in this library is probably dedicated to discord.py).Also, for pycord, you can reproduce the behavior of this library by usingdiscord.ext.pages.How To UseInstallpip install discord-ext-helpexampleimportdiscordfromdiscordimportapp_commandsfromdiscord.extimportcommandsfromdiscord_ext_helpimporthelpExtension,command_list,optionsfromreactionmenuimportViewMenucommand_list.cmdlist=[{"name":"/test","id":None,"description":"this is a test command!","args":[],"example":"https://media1.tenor.com/m/m1Tu9iU-zqQAAAAC/wumpus-discord.gif",},{"name":"/say","id":None,"description":"The character entered in the argument is uttered!","args":[{"name":"text","description":None,"required":True,}],"example":"https://media1.tenor.com/m/m1Tu9iU-zqQAAAAC/wumpus-discord.gif",},]bot=commands.Bot(command_prefix="!",intents=discord.Intents.all())@bot.eventasyncdefsetup_hook():# ↓ If you use the bot only within a particular guild ↓# await bot.tree.sync(guild=discord.Object(000000000000000000))# options.guild = 961559815191134229 # If you use the bot only within a particular guild# ↓ For use with a public Bot ↓awaitbot.tree.sync()# ↓ If you use the bot only within a particular guild ↓# @bot.tree.command(#     name="help", description="show help", guild=discord.Object(serverId)# )# ↓ For use with a public Bot ↓@bot.tree.command(name="help",description="show help")@app_commands.choices(command=options.cmds)asyncdefhelp(interaction:discord.Interaction,command:str=None):awaitinteraction.response.defer()res=awaithelpExtension.response(interaction,command)menu=res["resp"]ifres["type"]=="menu":awaitmenu.start()returnawaitinteraction.followup.send(embed=menu)helpExtension.setup()bot.run(token)
Package: discord-ext-interaction
Discord Extension InteractionIntroduceSlash Command is supported throughdiscord.py.Based on discord.ext.commands, compatible with existing frames.Compatibility listMoudle NameVersionTesteddiscord.pyv2.3.0✔️Pycordv2.4.1❌Plans to support py-cord, butdiscord-extension-interactionis not supported now.InstallingPython 3.9 or higher is required.To install the library, you can just run the following command:# Linux/macOS
python3 -m pip install -U discord-ext-interaction

# Windows
py -3 -m pip install -U discord-ext-interactionTo install the library with discord.py# Linux/macOS
python3 -m pip install -U discord-ext-interaction[discordpy]

# Windows
py -3 -m pip install -U discord-ext-interaction[discordpy]To install the development version, do the following:$gitclonehttps://github.com/gunyu1019/discord-extension-interaction
$cddiscord-extension-interaction
$python3-mpipinstall-U.Quick Examplefromdiscord.extimportinteractionfromdiscordimportIntentsintents=Intents.default()bot=interaction.Client(global_sync_command=True,intents=intents)@interaction.command(description="This is ping")asyncdefping(ctx:interaction.ApplicationContext):awaitctx.send("pong!")returnbot.add_interaction(ping)bot.run("TOKEN")You can find more examples in theexamplesdirectory.
Package: discord-ext-ipcs
discord-ext-ipcExample Clientimportdiscordfromdiscord.extimportipcsclient=discord.Client(intents=discord.Intents.all())ipc_client=ipcs.Client(client,"TopSecretKey")@client.eventasyncdefon_ready():asyncwithipc_client:awaitipc_client.connect("ws://localhost/ipc")@client.eventasyncdefon_ipc_connect():print("ipc connected")@client.eventasyncdefon_ipc_close():print("Ipc closed")@ipc_client.listen("ready")asyncdefipc_ready():print("ready")
Package: discord-ext-ipcx
discord-ext-ipcxAn maintained discord.py extension for inter-process communicationInstallationPython 3.8 or higher is requiredTo install the library, you can just run the following command:# On Linux/MacOSpython3-mpipinstalldiscord-ext-ipcx# On Windowspy-mpipinstalldiscord-ext-ipcxTo install the development version, do the following:$gitclonehttps://github.com/No767/discord-ext-ipcx
$cddiscord-ext-ipcx
$python3-mpipinstall-U.ResourcesDocumentationExamplesMotivation and differencesI forked and upgraded the discord-ext-ipc library to now work with discord.py v2 or higher. The primary reason why is that most of the "IPC" libraries out there are slow and I desperately needed a better IPC library for myself. The core has been kept almost intact, but here are some the changes worth noting:Thestartmethod is now an coroutine and needs to be awaited.Actually type hinting the libraryMore in the future may be added or deleted.
Package: discord-ext-levenshtein
A discord.py extension for command name suggestionInstallation# Windowspy-3-mpipinstall--upgradediscord-ext-levenshtein# Linuxpython3-mpipinstall--upgradediscord-ext-levenshteinUsageThe extension will be enabled by creatinglevenshtein.Levenshteinwhenon_readyis called.importosimportdiscordfromdiscord.extimportcommands,levenshteinclassMyBot(commands.Bot):def__init__(self,*args,**kwargs):super().__init__(*args,**kwargs)asyncdefon_ready(self):print('Bot is ready')levenshtein.Levenshtein(self,max_length=3)asyncdefon_command_suggest(self,ctx,suggested_commands):body='suggested commands: '+' '.join([f'`{command}`'forcommandinsuggested_commands])awaitctx.send(body)bot=MyBot(command_prefix='+',intents=discord.Intents.all())@bot.command()asyncdefping(ctx):awaitctx.send('pong')@bot.group(invoke_without_command=True)asyncdefmath(ctx):awaitctx.send('this is a math cog')@math.command()asyncdefadd(ctx,a:int,b:int):awaitctx.send(a+b)bot.run(os.environ['BOT_TOKEN'])For more usage, refer tothe examples directory
Package: discord-ext-modal-paginator
An extension for discord.py that allows you to paginate a Modal using buttons.As seen in the discord.py server’s Showcasechannel.Installationpython-mpipinstall-Udiscord-ext-modal-paginatorPyPI:https://pypi.org/project/discord-ext-modal-paginator/GitHub:https://github.com/Soheab/modal-paginatorExampleSeeexamples/verify_command.pyfor a complete example.
And read the source code for more information, it has docstrings and comments.DocumentationThe documentation is available athttps://discord-ext-modal-paginator.readthedocs.io/ContributingFeel free to open an issue or a pull request if you have any problems or improvements.
I would appreciate it if you could tell me on Discord first though, see my info below.ContactYou can contact me on Discord, my username isSoheab_(#6240) and ID150665783268212746. I’m fairly active on thediscord.py server. Feel free to ping me there.My own server is athttps://discord.gg/yCzcfju.LicenseThis project is licensed under theMLP-2.0license. See theLICENSEfile for more information.
Package: discord-ext-oauth
discord-ext-oauthAn asynchronous OAuth2 extension for discord.py.Read the documentation online.Installing the extensionInstalling the stable version:pipinstalldiscord-ext-oauthInstalling the development version:pipinstallgit+https://github/moanie/discord-ext-oauthExample Usageimportasynciofromdiscord.extimportoauthclient=oauth.OAuth2Client(client_id=000000000000000000,client_secret="CLIENT_SECRET",redirect_uri="https://www.google.com/",scopes=["identify","guilds","email","connections"])asyncdefmain():resp=awaitclient.exchange_code("access_token_here")user=awaitclient.fetch_user(resp)print(f"User ID:{user.id}")print(f"User Avatar URL:{user.avatar_url}")awaitclient.close()loop=asyncio.get_event_loop()loop.run_until_complete(main())OutputUserID:691406006277898302UserAvatarURL:https://cdn.discordapp.com/avatars/691406006277898302/5c8f69a903a8c5e34f93fe6ece5348c7.png
Package: discord-ext-owoify
discord-ext-owoifySimple ext package for owoifing text.InstallSimple paste this into your terminalpipinstalldiscord-ext-owoifyIf you need toupdateplease use the following:pipinstall--upgradediscord-ext-owoifySimple UseFirstly, import the package usingfromdiscord.extimportowoifyNow, lets use theowoify.owoify()attribute toowoifyyour text!fromdiscord.extimportowoifyprint(owoify.owoify("TEXT"))Wanna decode this now? Use theowoify.decode()attribute for this module.fromdiscord.extimportowoifyprint(owoify.decode("TEXT"))Note: The decode attribute is still in dev, as i need to find all words that would get owoified :)Devlepoment versionTo install this, you need to install from the githubpipinstall-Ugit+https://github.com/GreenDiscord/discord-ext-owoifyThanks! Please give feedback in issues :)
Package: discord-ext-paginator
discord-ext-paginatorAn package for discord pagination.How to installpipinstalldiscord-ext-paginatorExamplefromdiscord.extimportpaginatordefget_pages():pages=[discord.Embed(title=f"I'm the embed{i}!")foriinrange(1,6)]@bot.command()asyncdefpaginator(ctx):pag=paginator.Paginator(pages=get_pages())awaitpag.start(ctx)
Package: discord-ext-prettyhelp
discord-ext-prettyhelpAn embed version of the built in help command for discord.pyInspired by the DefaultHelpCommand that discord.py uses, but revised for embeds and additional sorting on individual pages that can be "scrolled" through with reactions.Installationpip install discord-ext-prettyhelpUsageExample of how to use it:fromdiscord.extimportcommandsfromdiscord.ext.prettyhelpimportPrettyHelpbot=commands.Bot(command_prefix="!",help_command=PrettyHelp())Added Optional Argscolor- Set the default embed colorending_note- Set the footer of the embed. Ending notes are fed acommands.Context(ctx) and aPrettyHelp(help) instance for more advanced customization.index_title- Set the index page name default is"Categories"menu- set a custom menu for navigating pages. Uses apretty_help.PrettyMenu()instance. Default ispretty_help.DefaultMenu()no_category- Set the name of the page with commands not part of a category. Default is "No Category"sort_commands- Sort commands and categories alphabeticallyshow_index- Show the index page or notpretty_help.DefaultHelp argsactive_time- Set the time (in seconds) that the message will be active. Default is 30spage_left- The emoji to use to page leftpage_right- The emoji to use to page rightremove- The emoji to use to remove the help messageBy default, the help will just pick a random color on every invoke. You can change this using thecolorargument:fromdiscord.extimportcommandsfromdiscord.ext.prettyhelpimportDefaultMenu,PrettyHelp# ":discord:743511195197374563" is a custom discord emoji format. Adjust to match your own custom emoji.menu=DefaultMenu(page_left="\U0001F44D",page_right="👎",remove=":discord:743511195197374563",active_time=5,)# Custom ending noteending_note=("The ending note from{ctx.bot.user.name}""\nFor command{help.clean_prefix}{help.invoked_with}")bot=commands.Bot(command_prefix="!")bot.help_command=PrettyHelp(menu=menu,ending_note=ending_note)The basichelpcommand will break commands up by cogs. Each cog will be a different page. Those pages can be navigated with
the arrow embeds. The message is unresponsive after 30s of no activity, it'll remove the reactions to let you know.
Package: discord-ext-prometheus
discord-ext-prometheusThis is a library that makes it easy to add prometheus metrics to your Python Discord bot.Installationpipinstalldiscord-ext-prometheusExposed MetricsNameDocumentationLabelsdiscord_connectedDetermines if the bot is connected to Discordsharddiscord_latencyLatency to Discordsharddiscord_event_on_interactionAmount of interactions called by usersshard,interaction,commanddiscord_event_on_commandAmount of commands called by usersshard,commanddiscord_stat_total_guildsAmount of guild this bot is a member ofNonediscord_stat_total_channelsAmount of channels this bot is has access toNonediscord_stat_total_usersAmount of users this bot can seeNonediscord_stat_total_commandsAmount of commandsNoneloggingLog entrieslogger,levelNotes:on_interactionare application interactions such as slash commands or modalson_commandare traditional message commands (usualy using the command prefix)Grafana DashboardAvailable to import fromGrafana dashboardsHow to useOnce the cog is added to your bot, the Prometheus metric endpoint can be accessed
atlocalhost:8000/metrics.Sample code with the Prometheus CogimportasynciofromdiscordimportIntentsfromdiscord.extimportcommandsfromdiscord.ext.prometheusimportPrometheusCogasyncdefmain():bot=commands.Bot(command_prefix='!',intents=Intents.all(),)awaitbot.add_cog(PrometheusCog(bot))awaitbot.start('YOUR TOKEN')asyncio.run(main())Sample code with logging metricsimportasyncioimportloggingfromdiscordimportIntentsfromdiscord.extimportcommandsfromdiscord.ext.prometheusimportPrometheusCog,PrometheusLoggingHandlerlogging.getLogger().addHandler(PrometheusLoggingHandler())asyncdefmain():bot=commands.Bot(command_prefix='!',intents=Intents.all(),)awaitbot.add_cog(PrometheusCog(bot))@bot.listen()asyncdefon_ready():logging.info(f'Logged in as{bot.user.name}#{bot.user.discriminator}')logging.info('Starting the bot')awaitbot.start('YOUR TOKEN')asyncio.run(main())Change the Prometheus portThe default port is8000but can be changed while creating the cog.awaitbot.add_cog(PrometheusCog(bot,port=7000))
Package: discord-ext-rx
discord-ext-rxWork In Progress!CombineRxPywithdiscord.py.Examplefromdiscord.ext.rximportRxBot,_fromrximportoperatorsasopsbot=RxBot()bot.messages.pipe(ops.filter(lambdam:m.author.id==121678432504512512),ops.filter(lambdam:m.content=='418'),ops.map(lambdam:m.channel)).subscribe(_(lambdac:c.send("I'm a teapot!")))bot.run('token')
Package: discord-ext-science
scienceA simple event logger fordiscord.py.Install$python3-mpipinstall-Udiscord-ext-scienceExtrasdatabasespackageYou may want to manually installdatabaseswith the correct drivers installed.Examplesfromdiscord.ext.scienceimportScientist,EventFlags,Configurationfromdiscord.ext.science.recorders.databasesimportDatabasesRecorderimportlogginglogging.basicConfig(filename='log.log',filemode='w',level=logging.DEBUG)config=Configuration(events=EventFlags.guilds(),recorder=DatabasesRecorder("url-to-my-database"))client=Scientist(config=config)client.run('TOKEN')
Package: discord-ext-slash
Support slash commands.Example Usagefromdiscord.extimportslashclient=slash.SlashBot(# normal arguments to commands.Bot()command_prefix='.',description="whatever",# special option: modify all global commands to be# actually guild commands for this guild instead,# for the purposes of testing. Remove this argument# or set it to None to make global commands be# properly global - note that they take 1 hour to# propagate. Useful because commands have to be# re-registered if their API definitions are changed.debug_guild=staging_guild_id)msg_opt=slash.Option(# description of option, shown when filling indescription='Message to send',# this means that the slash command will not be invoked# if this argument is not specifiedrequired=True)@client.slash_cmd()# global slash commandasyncdefrepeat(# command namectx:slash.Context,# there MUST be one argument annotated with Contextmessage:msg_opt):"""Make the bot repeat what you say"""# description of command# respond to the interaction, must be done within 3 secondsawaitctx.respond(message)# string (or str()able) messageclient.run(token)Notesdiscord.ext.slash.Contextemulatesdiscord.ext.commands.Context, but only to a certain extent.
Notably,ctx.messagedoes not exist, because slash commands can be run
completely without the involvement of messages. However, channel and author
information is still available.All descriptions arerequired.You must grant the botapplications.commandspermissions in the OAuth2 section of the developer dashboard.See thedocs.
Package: discord-ext-speedups
discord-ext-speedupsCython speedups for various parts of discord.pyInstallationpip install discord-ext-speedupsUsageimportdiscordfromdiscord.extimportspeedupsspeedups.install()This monkeypatches all available C extensions into discord.py, replacing the existing ones.  This is best done immediately afterimport discord.  To only install specific patches, pass the names toinstall().  For more info, see the reference section below.To revert patches, simply callspeedups.uninstall()to restore all modules to normal.  This function also takes specific module names as arguments.Note: You should probably avoid doing this while you're using the modules or objects this library alters.Available patchescopusCython bindings for libopus.  This was written as an experiment in cython and doesn't produce that much of a speedup.  A benchmark indicated a 10% speedup ofEncoder.encode(), but this also works out to a mere 0.5% of the total time window for this call (20ms/frame).Referenceinstall(*install_modules, ignore=False)Patches in replacement modules.*install_modules(str)Module names to install.  The list of available module names can be found above, or by callingget_available_patches().ignore(bool)If True, install all available modulesexceptthe given modules.Returns alist[str]of module names.uninstall(*uninstall_modules, ignore=False)Undo patching and restore the original modules.*uninstall_modules(str)Modules names to uninstall.  The list of installed module names can be found by callingget_installed_patches().ignore(bool)If True, uninstall all available modulesexceptthe given modules.get_available_patches()Returns atuple[str]of available module names.get_installed_patches()Returns atuple[str]of installed module names.RequirementsPython 3.6.4+discord.pyCompiling from source requires:cython0.27.3
Package: discord-ext-typed-commands
discord-ext-typed-commandsThis package contains a discord.py extension to provide classes to more easily use typed commandsInstallationpip install discord-ext-typed-commandsNOTE:Becausediscord.pyuses namespace packages for its extensions,mypymust be configured to use namespace packages either with the--namespace-packagescommand line flag, or by settingnamespace_packages = Truein yourmypyconfiguration file. See theimport discoverysection of themypydocumentation for more details.UsageThe most common usage will be in connection withdiscord.py-stubsin order to allow bot authors to use the command classes from discord.py while also using the generics defined in the stubs:fromtypingimportAny,Type,TypeVar,Union,cast,overloadimportdiscordfromdiscord.extimporttyped_commandsOtherContextType=TypeVar('OtherContextType',bound=typed_commands.Context)classMyContext(typed_commands.Context):asyncdefsend_with_hello(self,text:str)->None:awaitself.send(f'Hello!{text}')classMyCog(typed_commands.Cog[MyContext]):@typed_commands.command()asyncdefspeak(self,ctx:MyContext,text:str)->None:awaitctx.send_with_hello(text)classMyBot(typed_commands.Bot[MyContext]):@overloadasyncdefget_context(self,message:discord.Message)->MyContext:...@overloadasyncdefget_context(self,message:discord.Message,*,cls:Type[OtherContextType])->OtherContextType:...asyncdefget_context(self,message:discord.Message,*,cls:Type[OtherContextType]=cast(Any,MyContext),)->Union[MyContext,OtherContextType]:returnawaitsuper().get_context(message,cls=cls)my_bot=MyBot('$')my_bot.add_cog(MyCog())my_bot.run('...')NOTE: Because it is not a runtime dependency,discord.py-stubswill need to be explicitly installed to type check a bot while it is being developed. It is recommended that the stubs be added as a development dependency using your preferred method of package management.DevelopmentMake sure you havepoetryinstalled.poetry install
poetry run pre-commit install --hook-type pre-commit --hook-type post-checkout
Package: discord-ext-ui
This package is an extension of discord.ui.You can use pycord or discord.py.I hate pycord’s slash command system.why use discord-ext-ui?discord-ext-ui comes with a declarative View system and Combine system similar to SwiftUI.This makes it easier to implement architectures such as MVVM and to edit buttons after they have been submitted.Advantages of adopting discord-ext-uino more need to explicitly update the messageAs an example, let’s say you want to implement a function that allows you to increase or decrease the count using a button.If you want to implement it without using MVVM, you need to explicitly write a process to update the message to reflect the change in the internal state when the button is pressed.On the other hand, discord-ext-ui provides wrappers for variables such asstateandpublished. By using this wrapper, it is not necessary to explicitly write message updates according to changes in member variables.Also, since the function to be executed when the button is pressed can be set declaratively, it is possible to perform complex processing such as for loops. 2.easy to write when a button is usedWith discord-ext-ui, it is possible to change buttons when updating automatically, so it is easy to implement disabling/enabling according to instance variable values and changing buttons according to internal states such as pagination.ExampleSee./examples/.LICENSEMIT