Saravanan666/pypi-org huggingface dataset:
Package: discord-python-SniperThrilla
discord-pythonA discord API wrapper made for developing discord bots in python.FeaturesApplication CommandsMessage ComponentsModalsAutomatic Gateway IntegrationLow-level access to websocketsInstallationThere is currently no package, so just grab the files and dump them in your directory.Usage# Create a client and add two commands.client=Client.Client()# Register a new application command /help with a string parameter called "test" and responds with the function "help"client.registerApplicationCommand("help",Enums.ApplicationCommand.SUB_COMMAND,"my epic description",help,[ApplicationCommands.ApplicationCommandOption(3,"test",True)])# Register another application command called /menuclient.registerApplicationCommand("menu",Enums.ApplicationCommand.SUB_COMMAND,"testing select menus",menu)client.syncApplicationCommands()client.run("BOT TOKEN HERE")# For the /help command, the callback function is called help, but can be called anything.# Instead of registering the commands as above, you can use a decorator as follows.@client.AppCommand(name="help",type=Enums.ApplicationCommand.SUB_COMMAND,description="my epic description",parameters=[ApplicationCommands.ApplicationCommandOption(Enums.ApplicationCommand.STRING,"test","description",True)])defhelp(client:Client.Client,interaction:InteractionResponder.Interaction):# Respond with a message saying, "Hello, World!"response=InteractionResponder.InteractionResponseText(interaction=interaction,text="Hello, world!",ephemeral=True)# Create an action row.actionRow=InteractionResponder.ActionRow(client=client)# Adds a button to the message with the option set by the user as the labelactionRow.addComponent(InteractionResponder.Button(interaction.options[0]['value'],Enums.ButtonStyle.BLURPLE,client,"test1",callback=callback_test1))response.addActionRow(actionRow)response.generateJSON()# Send the message to discord!message=Message.Message(url=response.url,method=Message.HTTPMethods.POST,json=response.json,client=client)client.messageQueue.append(message)ContributingFeel free to open an issue to discuss any changes.LicenseGPLv3
Package: discord-qalib
Discord templating engine built on discord.py, to help separate text of embeds from the source code. Inspired by Flask.Key Features:use of xml files to hold the various template responsesallows for pagination, in an abstract form simplifying the interface in the source code:gear: Installing:Python3.8 or higher is required:test_tube: TestsTo run the tests, run the following command in the root directory:Windows:python-munittesttests-vLinux:python3-munittesttests-v:zap: UsageThis is explained in more detail in thewikiWrap expressions that need to evaluated with{}, such as{player.name}or{todays_date}Sample XML file:<discord><messagekey="test_key"><embed><title>Test</title><description>TestDescription</description><colour>magenta</colour><timestampformat="%Y-%m-%d %H:%M:%S.%f">{todays_date}</timestamp><url>https://www.discord.com</url><fields><field><name>TestField</name><value>TestText</value></field></fields><footer><text>TestFooter</text><icon>https://cdn.discordapp.com/embed/avatars/0.png</icon></footer><thumbnail>https://cdn.discordapp.com/embed/avatars/0.png</thumbnail><image>https://cdn.discordapp.com/embed/avatars/0.png</image><author><name>TestAuthor</name><icon>https://cdn.discordapp.com/embed/avatars/0.png</icon><url>https://discordapp.com</url></author></embed><view><components><buttonkey="understood_button"><label>Understood</label><style>success</style></button></components></view></message></discord>using the above xml file, for example, you can create an embed with the following code:importdatetimefromtypingimportLiteralimportdiscordfromdiscord.extimportcommandsimportqalibfromqalib.template_enginesimportformatterbot=commands.AutoShardedBot(command_prefix="!",intents=discord.Intents.all())Messages=Literal["test_key"]asyncdefacknowledged(interaction:discord.Interaction):awaitinteraction.response.send_message("Acknowledged",ephemeral=True)@bot.command()@qalib.qalib_context(formatter.Formatter(),"templates/test.xml")asyncdeftest(ctx:qalib.QalibContext[Messages]):callables={"understood_button":acknowledged}awaitctx.rendered_send("test_key",callables,keywords={"todays_date":datetime.datetime.now()})
Package: discord-racket
RacketDiscord bot utilities.I write discord bots for a small discord server with friends. This repo is a
collection of shared utilities I find myself re-writing for each bot.I have no idea if these utilities would scale well to a large bot, or if they
are bug free. They work pretty well for our small-scale usage.TODOAdd testingGithub actions testingLook into cutting releases using github actionsAfter passing tests cut new releaseAuto publish to pypiStore auth token on github
Package: discord-reargparse
discord_reargparseProvides support for RegEx based argument parsing in commands for thediscord.pylibrary.param_converter=RegExArgConverter(r"^(\S+[\ \S]*?)(?:\ -c(\d+))?(\ -n)?$",# OR re.compile(r"^(\S+[\ \S]*?)(?:\ -c(\d+))?(\ -n)?$"),string=Parameter(default="hello!",),count=Parameter(int,default=2,),new_line=Parameter(lambdax:bool(x),))# ...@bot.command()asyncdefrepeat(ctx,*,params:param_converter=param_converter.defaults):string=params["string"]count=params["count"]sep="\n"ifparams.get("new_line",False)else" "awaitctx.send(sep.join([string]*count))@repeat.errorasyncdefrepeat_error(ctx,error):ifisinstance(error,NotMatchedWithPattern):awaitctx.send("{0}not matched with pattern r'{1}'".format(repr(error.argstr),error.pattern.pattern,))On your discord server, the commands can be invoked like this:!repeat

> hello! hello!

!repeat Hi -c3 -n

> Hi
> Hi
> Hi

!repeat hello
world

    → will raise a NotMatchedWithPattern exceptionInstallationInstallation is available via pip:pip install discord_reargparseDocumentationInitialize anRegExArgConverteras in the example above, annotate a
keyword-only function argument in your command with the instance and,
optionally, set its default value by using the.defaultsattribute.
Setting a default value can be omitted for non-optional regex groups.It will raise aNotMatchedWithPatternexception if not matched
with given regex pattern.Inside the command, you can access the arguments as a dict.command's usageThe usage string of repeat command is displayed like.!help repeat

> repeat [params=Args(r'^(\S+[\ \S]*?)(?:\ -c(\d+))?(\ -n)?$' => [string=hello!] [count=2] <new_line>)]You might also want to set theusageparameter of thecommand()function
decorator to display a alternative usage string, especially when using theRegExArgConverter.defaultsattribute.
Package: discord-rebot
Welcome to discord-rebot (py)discordRebotis a RegEx based command mapping discord BOT framework
withauthorization.Why discordRebot?discordRebotis easy to use, minimal, and async ready framework
usingdiscord.pyMost of the bots uses a single prefix, string to match command and args
split by spaces, example!cmd arg1 arg2.But discordRebot uses RegEx for both matching the command and capturing
the arguments. It gives more control over both matching the command and
parsing arguments.Also, it provides authorization to authorize the author of the message
before executing the command.Basic ExampleA minimal bot with echo commandfromdiscordRebotimport*client=discord.Client()key=Mapper()@key(re.compile(r"^!echo (.*)$"))# Eg: '!echo hello' -> 'hello'defecho(msg,string):returnstringecho.auth=Noneclient.event(Manager(key).on_message)importos;client.run(os.environ["DBToken"])You can find more examples in the examples directory.FeaturesIt also supportsgeneratorsasynchronousfunctionsasynchronousgeneratorsExample:@key(re.compile(r"^!ticker (\d*) (\d*)$"))asyncdefticker(msg,delay,to):delay,to=int(delay),int(to)foriinrange(to):yieldiawaitasyncio.sleep(delay)Authorizes the message authorbased onuser_id example:1234567890user_name example:'user#1234'roles server(not applicable for DM)permissions of members in server(not applicable for DM)customCallable[[author], bool]Example:@key("am i authorized ?")defamiauthorized(msg):return"Authorized"amiauthorized.auth={1234567890,'user#1234'}# only executable by user1 (with id 1234567890) and user2 (with username 'user#1234')Can match multiple commands with a messageExample:@key(re.compile(r"^([\s\S]*)$"))defprintmsg(msg,content):print(f"@{msg.author}:")print(content)@key("whereami")defwhereami(msg):ifmsg.guild:returnmsg.guild.nameelse:return"DM"LinksDocumentationPyPidiscordpy-ext-rebotcomming soon (for full featured Discord Bot with RegEx based argparser)
Package: discord-repl
Discord REPLA discord bot to run code in containers.DevelopmentRequirementspython 3.10dockerInstall pipenvpython-mpipinstall--userpipenvPrepare the environmentpipenvinstall--devRun the testspipenvruntestRunning the botFirst of all you will need to create a application/bot on discord. Here are some usefully links:https://discord.com/developers/docs/introhttps://discord.com/developers/applicationsGet your bot token and add it to.envor as variable when running the bot.Using.env.Add to the.envecho"DISCORD_TOKEN=... >> .envRun the botpipenvrunbotTake care of your token, don't commit it.Using as variableDISCORD_TOKEN=...pipenvrunbot
Package: discordrich
AboutDiscord Rich is a Discord RPC library.Installationpip install discordrichExamples# Import DiscordRich
from discordrpc import *
import time

RPC = Presence('clientid')

# Start RPC Client
RPC.connect()

# Update RPC
RPC.update(state="Rich Presence using DiscordRich!")

while True:  # The presence will stay on as long as the program is running
    time.sleep(15) # Can only update rich presence every 15 secondsSyntaxPresenceUpdate:RPC.update(state)
RPC.update(start) 
RPC.update(large_image)   
RPC.update(small_image)   
RPC.update(party_id)   
RPC.update(join)   
RPC.update(match)
RPC.update(instance)Connect:RPC.connect()Close:RPC.close()Clear:RPC.clear()
Package: discord-rich-help.py
An extension which makes a rich-help command for discord.pyKey FeaturesSupports both message and slash commands.InstallingPython 3.8 or higher is required# Linux/MacOSpython3-mpipinstall-Udiscord-rich-help.py# Windowspy-3-mpipinstall-Udiscord-rich-help.pyBot Exampleimportdiscordfromdiscord.extimportcommandsfromdiscord_rich_helpimportRichHelpCommandintents=discord.Intents.default()intents.message_content=Truebot=commands.Bot(command_prefix='?',intents=intents,help_command=RichHelpCommand())bot.run('token')LinksDocumentationdiscord.py
Package: discord-rich-presence
discord-rich-presenceA lightweight and safe package for creating custom rich presences on Discord.ExampleHow to UseMaking a Discord AppCreate an app by clicking "New Application" in theDiscord Developers Portal.Give your app a name and an icon (this can be changed later). Make sure to save your changes.Optional:Go to "Rich Presence", and add a few images under the "Rich Presence Assets" section.Under "Application Id" in the "General Information" tab, copy your app's id.InstallationInstall the latest version ofPythonif you haven't already.Run the following in your terminal:$ pip install discord-rich-presenceIf all goes well, it should say something like "Successfully installed discord-rich-presence".Writing the CodeCreate a file ending in.py, and paste in the following example fromexamples/simple.py:fromdiscordrpimportPresenceimporttimeclient_id="000000000000000000"# Replace this with your own client idwithPresence(client_id)aspresence:print("Connected")presence.set({"state":"In Game","details":"Summoner's Rift","timestamps":{"start":int(time.time())},})print("Presence updated")whileTrue:time.sleep(15)Make sure you replace theclient_idvariable with your app's id that you copied earlier.Run the program! You should now see that you have a rich presence on your profile that will be on until you stop the program! Feel free to change the code however you want by adding images, buttons, and more. Check outexamples/complex.pyfor another example.TroubleshootingHere are the most common errors:ActivityError: An incorrect dictionary was passed toPresence.set. Make sure that it matches theformat expected by Discord.ClientIDError: Verify that your client ID is valid.PresenceError: Read theDiscord docsfor more information.ConnectionRefusedErrororFileNotFoundError: Make sure that your Discord application is open and logged in.Program hangs for a long time and does not set the presence: Wait for at least 10 seconds before closing and trying again.
Package: discordrouter
Discord RouterA simple router decorator fordiscord.pychat bots.Installationpip3 install discordrouterUsagefromdiscordrouterimportRouter,messageclassChatBot(discord.Client):router=Router('!test')asyncdefon_ready(self):print(f'Logged in as{self.user.name}')asyncon_message(self,message):awaitself.router(message)@message(router,"new <name>")async_test1(self,items,message):name=items['name']awaitmessage.channel.send('{name}')
Package: discord-rpc
Discord RPCAn Python wrapper for Discord RPC API. Allow you to make own custom RPC.InstallPyPIpip install discord-rpcQuick exampleimportdiscordrpcrpc=discordrpc.RPC.set_id(app_id=12345678910)rpc.set_activity(state="pip install discord-rpc",details="Discord RPC")rpc.run()Note thatrpc.run()is only required to keep your program alive. If another task is doing so then it isn't required.More exampleshereOtherJoin our Discord serverhereLicence & CopyrightThis Project under MIT License
Copyright (c) 2021-present EterNomm
Package: discord-rpc.py
discord-rpc.pyA Discord RPC library for Python 2 & 3.InstallationInstall discord-rpc.py withpipFor the latest stable version:pip install discord-rpc.pyFor the latest development version:gitclonehttps://gitlab.com/somberdemise/discord-rpc.pycddiscord.pypython-mpipinstall-U.Examplesimportdiscord_rpcimporttimeif__name__=='__main__':defreadyCallback(current_user):print('Our user:{}'.format(current_user))defdisconnectedCallback(codeno,codemsg):print('Disconnected from Discord rich presence RPC. Code{}:{}'.format(codeno,codemsg))deferrorCallback(errno,errmsg):print('An error occurred! Error{}:{}'.format(errno,errmsg))# Note: 'event_name': callbackcallbacks={'ready':readyCallback,'disconnected':disconnectedCallback,'error':errorCallback,}discord_rpc.initialize('token',callbacks=callbacks,log=False)i=0start=time.time()whilei<10:i+=1discord_rpc.update_presence(**{'details':'Iteration #{}'.format(i),'start_timestamp':start,'large_image_key':'default'})discord_rpc.update_connection()time.sleep(2)discord_rpc.run_callbacks()discord_rpc.shutdown()
Package: discordrp-pcsx2day
Discord Rich Presence for PCSX2Installation:pipinstalldiscordrp-pcsx2Usage$ discordrp-pcsx2 --help
Discord Rich Presence support for PCSX2.

Usage:
    discordrp-pcsx2 [--path=<path>]

Options:
    --path=<path> Path to your PCSX2 directory, optional.discordrp-pcsx2is still very early in development, so feel free to report any issueshere!ExamplesCover ArtDue to the nature of Rich Presence assets, Images that are used for cover art must be added by me manually.Create an issueif you would like to suggest cover art for a specific game.
Package: discordrp-pcsx2n
Discord Rich Presence for PCSX2Installation:pipinstalldiscordrp-pcsx2Usage$ discordrp-pcsx2 --help
Discord Rich Presence support for PCSX2.

Usage:
    discordrp-pcsx2 [--path=<path>]

Options:
    --path=<path> Path to your PCSX2 directory, optional.discordrp-pcsx2is still very early in development, so feel free to report any issueshere!ExamplesCover ArtDue to the nature of Rich Presence assets, Images that are used for cover art must be added by me manually.Create an issueif you would like to suggest cover art for a specific game.
Package: discordsdk
Discord Game SDK for PythonA Python wrapper around Discord's Game SDK.NOTE: This is entirely experimental, and may not work as intended. Please report all bugs to theGitHub issue tracker.Credit toNathaanTFMfor creating theoriginal library.InstallationInstall the module:WithPIP:Stable:python -m pip install discordsdkLatest:python -m pip install git+https://github.com/LennyPhoenix/py-discord-sdk.gitWithsetup.py(latest):git clone https://github.com/LennyPhoenix/py-discord-sdk.gitcd py-discord-sdkpython -m setup installDownloadDiscord Game SDK (2.5.6).Grab the DLL fromdiscord_game_sdk.zipin thelibdirectory and put it in your project'slibdirectory.DocumentationIf you need documentation, look atthe official Game SDK docs; this was made following the official documentation.
We also have somework-in-progress wiki docs.FeaturesShould be working:ActivityManagerImageManagerNetworkManagerRelationshipManagerStorageManagerUserManagerShould be working, but need more testing:AchievementManager(not tested at all)ApplicationManager(especially the functionsGetTicketandValidateOrExit)LobbyManagerOverlayManagerStoreManager(not tested at all)VoiceManagerContributingThe code needsmore comments, type hinting. You can also implement themissing features, or addmore tests. Feel free to open apull request!You can alsoreport issues. Just open an issue and I will look into it!Todo ListBetter organisation of submodules.CI/CD.Update sdk.py to use type annotations.Update to Discord SDK 3.2.0.ExamplesYou can find more examples in theexamples/directory.Create a Discord instanceimporttimeimportdiscordsdkasdsdkapp=dsdk.Discord(APPLICATION_ID,dsdk.CreateFlags.default)# Don't forget to call run_callbackswhile1:time.sleep(1/10)app.run_callbacks()Get current userimporttimeimportdiscordsdkasdsdkapp=dsdk.Discord(APPLICATION_ID,dsdk.CreateFlags.default)user_manager=app.get_user_manager()defon_curr_user_update():user=user_manager.get_current_user()print(f"Current user :{user.username}#{user.discriminator}")user_manager.on_current_user_update=on_curr_user_update# Don't forget to call run_callbackswhile1:time.sleep(1/10)app.run_callbacks()Set activityimporttimeimportdiscordsdkasdsdkapp=dsdk.Discord(APPLICATION_ID,dsdk.CreateFlags.default)activity_manager=app.get_activity_manager()activity=dsdk.Activity()activity.state="Testing Game SDK"activity.party.id="my_super_party_id"activity.party.size.current_size=4activity.party.size.max_size=8activity.secrets.join="my_super_secret"defcallback(result):ifresult==dsdk.Result.ok:print("Successfully set the activity!")else:raiseException(result)activity_manager.update_activity(activity,callback)# Don't forget to call run_callbackswhile1:time.sleep(1/10)app.run_callbacks()
Package: discordselfbot
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.Key FeaturesModern Pythonic API usingasyncandawait.Proper rate limit handling.100% coverage of the supported Discord API.Optimised in both speed and memory.InstallingPython 3.5.3 or higher is requiredTo install the library without full voice support, you can just run the following command:# Linux/macOSpython3-mpipinstall-Udiscord.py# Windowspy-3-mpipinstall-Udiscord.pyOtherwise to get voice support you should run the following command:# Linux/macOSpython3-mpipinstall-U"discord.py[voice]"# Windowspy-3-mpipinstall-Udiscord.py[voice]To install the development version, do the following:$gitclonehttps://github.com/Rapptz/discord.py$cddiscord.py$python3-mpipinstall-U.[voice]Optional PackagesPyNaCl (for voice support)Please note that on Linux installing voice you must install the following packages via your favourite package manager (e.g.apt,dnf, etc) before running the above commands:libffi-dev (orlibffi-develon some systems)python-dev (e.g.python3.6-devfor Python 3.6)Quick ExampleimportdiscordclassMyClient(discord.Client):asyncdefon_ready(self):print('Logged on as',self.user)asyncdefon_message(self,message):# don't respond to ourselvesifmessage.author==self.user:returnifmessage.content=='ping':awaitmessage.channel.send('pong')client=MyClient()client.run('token')Bot Exampleimportdiscordfromdiscord.extimportcommandsbot=commands.Bot(command_prefix='>')@bot.command()asyncdefping(ctx):awaitctx.send('pong')bot.run('token')You can find more examples in the examples directory.LinksDocumentationOfficial Discord ServerDiscord API
Package: discord-sender
Discord SenderDescriptionA discord module that lets you send messages as a userWhy this?Other discord self-bots have more features but take up much more space. This can only send messages (for now) and is much more lightweight.InstallationInstall Using pip:pip install discord-senderUsageCreate a User:# Import the moduleimportdiscord_sender.discord# Create a useruser=discord_sender.discord.DiscordUser()Authenticate with discordToken Authentication (recommended):user.login_with_token(<token>)Credential Authentication:user.login_with_credentials(<email>,<password>)Send a messageuser.send_message_to_userID(<message>,<useridofrecipient>)Other commandsCheck if user is logged inifuser.logged_in():do_stuff()Send a message to a channel idAlso works in serversuser.send_message_to_channel(<message>,<channelid>)Get channel id for dm with user by user iduser.get_channel_id(<useridofrecipient>)Get a logged in users token# Works even if credential auth was used# Returns None if not logged inuser.user_info.get_token()Get dmsuser.get_dms(<niceformatting,TrueorFalse>)Get user info by iduser.get_user_info_by_id(<userid>)Experimental:Send message to usernameuser.send_message_to_username(<message>,<username>)Get channel infouser.get_channel_info(<channelid>)Get user info by usernameuser.get_user_info_by_username(<username>)For the futureAdd cookie authenticationAdd sending in serversAdd tests
Package: discord-sentry-reporting
Discord.py Sentry ReportingThis is a small compatibility library that provides functionality to report errors from Discord.py to Sentry.Usagefromdiscord_sentry_reportingimportuse_sentryuse_sentry(discord_client_object,# it is typically named client or botdsn="your_dsn_here"# put in any sentry keyword arguments (**kwargs) here)
Package: discordservices.py
discordservices.pyA Simple Python API Wrapper for discordservices.netUsageInstallation:Via pip:pip install discordservices.pyWith autopost:importdiscordimportdiscordservicesfromdiscord.extimportcommandsbot=commands.Bot(command_prefix="!")bot.dsclient=discordservices.DSClient(bot,'apitoken',autopost=True)# default to False, if sets True it will autoposts every 900 secondsbot.run('token')Without autopost:importdiscordimportdiscordservicesfromdiscord.extimportcommandsbot=commands.Bot(command_prefix="!")bot.dsclient=discordservices.DSClient(bot,'apitoken',autopost=False)@bot.eventasyncdefon_guild_join(guild):awaitbot.dsclient.post_count()print("Guild count posted")bot.run('token')
Package: discordshell
DShellDescriptionDiscord shell or dshell for short is a Python package that combines withdiscord.pyandJishakuto transform an ordinary Discord channel into one capable of running bash commands using a Discord bot.Typical usageWhen would I use this?When you want to use shell commands on your virtual private server (VPS) without logging into itWhen you want a collaborative terminal with other developers of your teamWhen you're simply too lazy to open your shell and would rather do it in an open Discord appWhen you want to run shell commands from your Discord bot's directory easilyWhen you want to run shell commands on something that simply looks better than your shellMain Features- Customizable- Easy to use- Asynchronous- Compatible with discord.py v2.0- Lightweight- Regularly maintainedLinksDocumentationPyPIIssue TrackingDiscord serverInstallation and upgradespip install discordshellfor the stable version (recommended).pip install -U discordshellto update your stable version.pip install git+https://github.com/ImNimboss/dshellto install it straight off of GitHub (you need git installed for this).pip install -U git+https://github.com/ImNimboss/dshellto upgrade your version that you got from GitHub.How to useCheckDocumentation/Basics.mdExamplesCheckDocumentation/Examples.md
Package: discord-simple-pretty-help
Discord simple pretty helpA simple yet pretty help menu for discord.py botsInstallationpip install git+https://github.com/victorbnl/discord-simple-pretty-helpUsagefromdiscord_simple_pretty_helpimportSimplePrettyHelpbot=commands.Bot(help_menu=SimplePrettyHelp())Parameterscolor: color of the embed (default: 0x5865F2)