Saravanan666/pypi-org huggingface dataset:
Package: discord-slash-components-bridge
discord-py-slash-components-bridgeBridge for discord-interactions and discord-componentsWelcomediscord-interactionsanddiscord-componentsare incompatible and this bridge can compatible these libs.This lib overrides discord-interaction classes and methods for working with discord-components components(Selects and Buttons)How to use?fromdiscord.extimportcommands#from discord_slash import SlashCommand # No need anymorefromdiscord_slash_components_bridgeimportSlashCommandbot=commands.Bot(...)slash=SlashCommand(bot,...)Migration from discord-componentsIf you have used this, then I prepared for you some things.Eventsbutton_clickandselect_optionhave been saved.Eventinteractionnow iscomponent.Interactionis not available to use. Now it'sComponentContextand now you need use methods ofComponentContext
Package: discord-sls
Discord SLSA set of tools for building a discord bot with a serverless architecture in mind. If you are looking for a more complete discord sdk, check outdiscord.py.Install with pip:pip install discord_slsExample/Template RepoUsageThe library provides a decorator@bot_handlerwhich can be used to decorate a lambda handler to respond to discord api requests.
It will handle the ping-pong handshake, and will parse the request body into a python object for you to use. The decorator expects you to returnIneraction Callback Data.Discord expects a quick response to the initial request, if your bot needs longer to handle an interaction you can use thesend_command_to_queuefunction to send the command to a queue for processing in another lambda decorated with@deferred_response_handler. The queue is determined by theLONG_RESPONSE_QUEUEenvironment variable.importjsonimportloggingfromdiscord_slsimportInteraction,bot_handler,deferred_response_handler@bot_handlerdefdiscord_bot(command_body,send_command_to_queue):command_name=command_body.get("data",{}).get("name")ifcommand_name=="hello":return{"content":"Hello Moto"}elifcommand_name=="helloasync":send_command_to_queue(command_body)return{"content":"Hello..."}else:logging.warn(f"unhandled command:{command_name}")return{"content":"Unknown Command"}@deferred_response_handlerdeflong_response_handler(interaction:Interaction):interaction.follow_up({"content":"Hello...async"})Keeping the bot warmWith most serverless architectures you will need to keep your lambdas warm to avoid cold start times. A popular mechanism for doing that is using cloudwatch event rules, the@bot_handlerdecorator will automatically handle these requests for you.T his is what a SAM template could look like for the rule:BotKeepWarm:
  Type: AWS::Events::Rule
  Properties:
    Description: Keeps the bot lambda warm
    Name: !Sub 'keep-warm-${Stage}'
    ScheduleExpression: rate(5 minutes)
    Targets:
      - Id: KeepWarmDiscordBot
        Arn: !GetAtt DiscordBotFunction.Arn
Package: discordSplash
discord-splashAn API wrapper for Discord's slash commands.Docs:Docs are hosted onReadTheDocs.NOTE:you are required to make the slash commands via the Discord API.Currentlythis is not possible via this API wrapper.Examples:Simple bot that responds with "hi"fromdiscordSplashimportRunimportdiscordSplash@discordSplash.command(name='hello')asyncdefhello(data):awaitdata.respond(discordSplash.ReactionResponse("hi"))Run('TOKEN')Presence ExamplefromdiscordSplashimportRun,PresenceimportdiscordSplashx=Presence(text='testing',presenceType=discordSplash.PresenceType.Game)Run('TOKEN',x)InstallationUsepip install discordSplash
Package: discordspy
discords.pyThe offical Python API wrapper for Discords.comNoticesThis is the first version with limited coverage of API endpoints, more features, functionality and documentation will be added in the future.Installation:pip install discords.pyFeaturesServer count postingBuilt-in automatic & interval server count postingBuilt-in voting webhook handlerVoting & server posting eventsExamplesAutomatic server count posting with eventAutoposting posts the servercount whenever a server is joined/removed while abiding with ratelimitsfromdiscord.extimportcommandsimportdiscordspybot=commands.Bot("!")discords=discordspy.Client(bot,DISCORDS_TOKEN,post=discordspy.Post.auto())@bot.eventasyncdefon_discords_server_post(status):ifstatus==200:print("Posted the server count:",discords.servers())bot.run(TOKEN)Interval server count posting every hour and a halffromdiscord.extimportcommandsimportdiscordspybot=commands.Bot("!")post=discordspy.Post.interval(minutes=30,hours=1)discords=discordspy.Client(bot,DISCORDS_TOKEN,post=post)@bot.eventasyncdefon_discords_server_post(status):ifstatus==200:print("Posted the server count:",discords.servers())bot.run(TOKEN)Webhook voting eventIMPORTANT:Your webhook url must end with/discordswebhookif you wish to use a different path, please specify it using the path argument inside the webhook methodpath="/customwebhook", by default the port is 8080fromdiscord.extimportcommandsimportdiscordspybot=commands.Bot("!")discords=discordspy.Client(bot,DISCORDS_TOKEN)discords.webhook(port=2296,auth="password")@bot.eventasyncdefon_discords_server_post(status):ifstatus==200:print("Posted the server count:",discords.servers())bot.run(TOKEN)
Package: discord-styled-text
discord-styled-textA small library to style text for Discord without having to remember any syntaxInstallationdiscord-styled-textrequires Python 3.6 at minimum.$ pip install discord-styled-textDocumentationDocumentation is available onReadTheDocs.Example Usage>>>fromdiscord_stylerimport*>>>bold_text=Bold("Here's some bold text")>>>italic_text=Italic("and here's some",Underline("italic text"),"with nested styles!")>>>text=StyledText("We can combine them:",bold_text,italic_text)>>>str(text)"We can combine them: **Here's some bold text** *and here's some __italic text__ with nested styles!*">>>quoted=StyledText(BlockQuote(text),"and we can do quotes too")>>>str(quoted)"> We can combine them: **Here's some bold text** *and here's some __italic text__ with nested styles!*\nand we can do quotes too">>>question=StyledText(...UserMention(200102491231092736),...f"will you be free at{TimeStamp(1618953630,TimeStyle.LongDateTime)}?",...f"I'll be doing code review in{ChannelMention(656893570711814145)}if you wanna join")>>>str(question)"<@200102491231092736> will you be free at <t:1618953630:F>? I'll be doing code review in <#656893570711814145> if you wanna join">>>link=NonEmbeddingURL("https://github.com/miaowware/discord-styled-text/pull/1")>>>str(link)'<https://github.com/miaowware/discord-styled-text/pull/1>'>>>code=StyledText(..."What do you think of this?\n",...CodeBlock('def __str__(self) -> str:\nreturn "||" + super().__str__() + "||"',lang="py"))>>>str(code)'What do you think of this?\n```py\ndef __str__(self) -> str:\nreturn "||" + super().__str__() + "||"\n```'CopyrightCopyright 2021 classabbyamp, 0x5cReleased under the BSD 3-Clause License.SeeLICENSEfor the full license text.
Package: discord-surveys
discord-surveysA survey object that utilizes discord.py and discord-interactions.ExamplesDiscordPythonfromdiscord_surveysimportSurveyasyncdefsurvey(self,ctx:SlashContext,question:str,options:str):awaitSurvey(bot=ctx.bot,ctx=ctx,question=question,options=options).send()DescriptionAttributesDescriptionbotdiscord.Botordiscord.AutoShardedBotctxdiscord_slash.context.SlashContextembeddiscord.Embedoptionsstrand then converted toSurveyOption.timeout(Optional)int
Package: discordtemplate
Discord Template🔹 A new and enhanced boilerplate template for discord.pyAbout|Installation|Usage|Contributors|LicenseAboutDiscord Templateis a Discord CLI used for creating boilerplate for bot developers out there who want to develop bots, easily and fast!
Discord Template offers you a development and deployment system (heroku) (coming soon). It's easy to use and reliable.InstallationDiscord Template is available onPyPipip install discordtemplateUsagediscord create bot_nameContributorsFor contirbuting, seeCONTRIBUTING.mdThanks to these contributors who made the project maintained!ZenqiLicenseMIT
Package: discord-timers
discord-timersA simple extension for discord.py which provides basic timer support.Installingpipinstalldiscord-timers-UExampleimportdatetimefromdiscord.extimportcommands,timersbot=commands.Bot(command_prefix="!")bot.timer_manager=timers.TimerManager(bot)@bot.command(name="remind")asyncdefremind(ctx,time,*,text):"""Remind to do something on a date.The date must be in ``Y/M/D`` format."""date=datetime.datetime(*map(int,time.split("/")))bot.timer_manager.create_timer("reminder",date,args=(ctx.channel.id,ctx.author.id,text))# or without the managertimers.Timer(bot,"reminder",date,args=(ctx.channel.id,ctx.author.id,text)).start()@bot.eventasyncdefon_reminder(channel_id,author_id,text):channel=bot.get_channel(channel_id)awaitchannel.send("Hey, <@{0}>, remember to:{1}".format(author_id,text))bot.run("token")
Package: discord-timestamps
discord-timestampsdiscord-timestampsgenerates properly-formatted dynamic timestamps for
Discord messages, with support for Arrow objects.>>>format_timestamp(datetime(2021,11,20,12,0,0))'<t:1637409600>'>>>format_timestamp(datetime(...),TimestampType.RELATIVE)'<t:1637409600:R>'Installationdiscord-timestamps is available on PyPI:$pipinstalldiscord-timestampsdiscord-timestamps officially supports Python 3.6+.API ReferenceSee thewikifor
discord-timestamps's documentation.
Package: discord-together
Discord TogetherDiscord has released a BETA feature that they call Discord Party Games or Activities, which allows members to play a large variety of games within a server voice channel. While this feature has officially only been provided to certain hand-picked servers, this module allows you to temporarily enable such features for your servers!Use thedocs for discord-togetherfor detailed usage guide.As of the latest release, this BETA feature is only supported on web and updated PC app versions of Discord and is not supported on mobile.🔩 InstallationInstalldiscord-togetherpip install discord-togetherPackage dependencies only includeaiohttp🔑 FeaturesNo specific API wrapper dependencies, works with discord.py and any of its forksEasy to use and lightweightActively maintained and updated with latest activitesDebug mode for invalid invites💻 Code exampleThis is a simple example of code using this package (with discord.py 1.7.2) to create an invite for a YouTube Watch Together in the channel that the command invoker is currently in.fromdiscord.extimportcommandsfromdiscord_togetherimportDiscordTogetherclient=commands.Bot(command_prefix="~")@client.eventasyncdefon_ready():client.togetherControl=awaitDiscordTogether("BOT_TOKEN_HERE")print('Bot is online!')@client.command()asyncdefstart(ctx):link=awaitclient.togetherControl.create_link(ctx.author.voice.channel.id,'youtube')awaitctx.send(f"Click the blue link!\n{link}")client.run("BOT_TOKEN_HERE")View thedocsfor more detailed/advanced examples (like cogs) and explanations!📷 Image⚠️ Advisory Note:At least one person needs to click on theBLUE LINK, not the 'Play' button, in order to start the activity! Once the activity is started, people can join by clicking 'Play'.🚀 OthersThis package is under MIT license.Appropriately tested PR's are more than welcome.Note: This package is not affiliated with Discord or YouTube.If you have any problems or enquiries, join thediscord-together Support Serveror you can contact me personally on Discord:Bxllistic#4444.This project was converted to support python from the npm packagediscord-togetherMade with ❤ by BxllisticCredits to@RemyK888for initial foundations
Package: discordtool
A fork of discord.py. Pycord is 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.Optimised for both speed and memory usage.Full Application Command SupportInstallingPython 3.8 or higher is requiredTo install the library without full voice support, run the following command:# Linux/macOSpython3-mpipinstall-Upy-cord# Windowspy-3-mpipinstall-Upy-cordOtherwise, to get full voice support, run the following command:# Linux/macOSpython3-mpipinstall-U"py-cord[voice]"# Windowspy-3-mpipinstall-Upy-cord[voice]To install additional packages for speedup, run the following command:# Linux/macOSpython3-mpipinstall-U"py-cord[speed]"# Windowspy-3-mpipinstall-Upy-cord[speed]To install the development version, do the following:$gitclonehttps://github.com/Pycord-Development/pycord$cdpycord$python3-mpipinstall-U.[voice]or if you do not want to clone the repository:# Linux/macOSpython3-mpipinstallgit+https://github.com/Pycord-Development/pycord# Windowspy-3-mpipinstallgit+https://github.com/Pycord-Development/pycordOptional PackagesPyNaCl(for voice support)aiodns,brotlipy,cchardet(for aiohttp speedup)orjson(for json speedup)Please note that while installing voice support on Linux, you must install the following packages via your preferred package manager (e.g.apt,dnf, etc) BEFORE running the above commands:libffi-dev (orlibffi-develon some systems)python-dev (e.g.python3.10-devfor Python 3.10)Quick Exampleimportdiscordbot=discord.Bot()@bot.slash_command()asyncdefhello(ctx,name:str=None):name=nameorctx.author.nameawaitctx.respond(f"Hello{name}!")@bot.user_command(name="Say Hello")asyncdefhi(ctx,user):awaitctx.respond(f"{ctx.author.mention}says hello to{user.name}!")bot.run("token")Traditional Commands Exampleimportdiscordfromdiscord.extimportcommandsintents=discord.Intents.default()intents.message_content=Truebot=commands.Bot(command_prefix=">",intents=intents)@bot.command()asyncdefping(ctx):awaitctx.send("pong")bot.run("token")You can find more code examples in theexamplesdirectory.Note: Make sure you do not reveal your bot token to anyone, as it can grant access to your bot.Useful LinksDocumentationLearn how to create Discord bots with PycordOur Official Discord ServerOfficial Discord Developers Server
Package: discordtools
DiscordToolsA collection of useful tools for managing a Discord serverInstall$ pip install discordtoolsUsageDownloading avatars➜ discordtools download-avatars --help
Usage: discordtools download-avatars [OPTIONS]

Options:
  -t, --token TEXT              Discord Token. DISCORD_TOKEN envvar.
                                [required]
  -g, --guild-id TEXT           Guild ID. DISCORD_GUILD_ID envvar.  [required]
  -r, --role TEXT               Filter users by role
  -p, --path DIRECTORY          Path of the folder to save the avatars.
                                DISCORD_AVATAR_PATH envvar.  [required]
  -i, --include-default-avatar  Include users with default avatar.
                                DISCORD_INCLUDE_DEFAULT_AVATAR envvar.
  --help                        Show this message and exit.
Package: discord-to-sqlite
discord-to-sqliteImport data from your Discord Data Package into a SQLite database.How to install$ pip install discord-to-sqliteFirst, requestyour Discord data- wait for the email and download the zip file.This tool currently supports importing messages, friends, servers and channels. More may be added in the future.How to useImport the downloadedpackage.zipfile with the following command:$ discord-to-sqlite discord.db path/to/package.zipThis will create a database file calleddiscord.dbif one does not already exist.Browsing your data with DatasetteOnce you have imported Discord data into a SQLite database file you can browse your data usingDatasette. Install Datasette like so:$ pip install datasetteNow browse your data by running this and then visitinghttp://localhost:8001/$ datasette discord.dbCreditsThis package is heavily inspired bygoogle-takeout-to-sqlitebySimon Willison.The package is designed to fit into thedogsheep/datasetteecosystems.
Package: discordtownlistpy
discordtownlistpyThis is an unofficial Python API Wrapper for theDiscord TownList (bot list).Posting Server Countimportdiscordtownlistpyasdtl...dtl.postGuildCount(len(bot.guilds),"<YOUR_API_TOKEN>")Retrieving Bot Dataimportdiscordtownlistpyasdtl...@bot.command()asyncdefbotstats(ctx,bot_id):bot_data=awaitreturnBotData(bot_id)...
Package: discord-travisbot
A bot for Discord. (Work in progress)DevelopmentTo setup and run the basic steps of the bot.RequirementsPython 3.6ngrokInstallation$python-mvenv.$.bin/activate(travisbot)$pipinstall-e.[fast]RunningThe secret token is read from the environment variables.(travisbot)$exportTOKEN=...(travisbot)$python-mtravisbotIn a separate process, runngrok.$ngrokhttp8888Then, configure the notifications of your project to point to the given URL:Configuring webhook notificationsReleaseUpdate the version number and clean up thedistdirectory before-hand.(travisbot)$pythonsetup.pyregister-rhttps://pypi.python.org/pypi(travisbot)$pipinstallwheeltwine(travisbot)$rm-fdist/*(travisbot)$pythonsetup.pysdistbdist_wheel(travisbot)$twineuploaddist/*TravisTravis CI should handle the release process for us.BibliographyA Discord bot with asyncioDiscord API Referencediscord.py
Package: discord-typed-flags
Typed FlagsA Typehint based system for including flag input in your discord.py commands.Why bother with numerous decorators and patched commands when you just typehint your input to receive command flags?ExamplesUsage is as simple as typehinting the entire input argument string toTypedFlags, this in turn will convert everything and will return this argument as adictofkey:valuepairs where eachkeyis the flag, and thevalueis the value for that flagfromtyped_flagsimportTypedFlags@bot.command()asyncdeftest(ctx,*,args:TypedFlags):# Send all of command argsawaitctx.send(args)An example calling the above code:%test this "Lol ez" --try:=test string --hard:=This is kinda coolargs={None:['this','Lol ez'],'try':'test string','hard':'This is kinda cool'}A further example:%test --try:=test string --hard:=lol This is kinda coolargs={'try':'test string','hard':'lol This is kinda cool'}Note: Since we have no argless arguments, it is not in the returned dataCustomizationYou can customize two things, the string to preceed any flag values as well as the string to split up between the flag and its value.
Both of these are keyword arguments when initializingTypedFlagsstart: str -> The string to preceed any flags (Defaults to--)delim: str -> What to split flags with to get thekey:valuesplit (Defaults to:=)You do not have to provide these values. There are defaults in place. It is only for customization purposesImportant NotesThis package works in-line with how discord.py handles command parsing and consumption. That is to say the argumentHello worldwill betwovariables, where as the argument"Hello world"will be parsed as one argument. This is something important to understand otherwise you will experience unexpected behaviour.However, this only applies to 'flagless' arguments. Values between flags are considered to be all part of said flag (See examples)Any argumentsnotassociated with a flag will be added to the dictionary under the keyNone. The value for this key is alistcontaining all of the arguments found that do not corrospond to a given flag.It isalsoimportant to note that if no flagless values are detected then this keywill notbe in the dictionary. You should check for this in your code.Any arguments inarglessare ordered according to the order they were received.
Package: discord-user-history
discord-user-historyThis package helps to communicate between a python discord bot and our service api. To use the package you'll need a verification token.
You can request verification tokens via email. (iampekka058@gmail.com)Install the packagepipinstalldiscord-user-historyDocumentationThe Package is in an early state of development. The documentation will be edited soon.User ObjectUser replicates a discord user.uuid (A uniqe id given by discord)name (e.g. IamPekka058)id (e.g. #0000)user=User(uuid,name,id)string getID()Returns id of user.string getName()Returns name of user.string getUUID()Returns uuid of user.string getPrintable()Returns printable user object.
Format: (Name)#(ID)<(UUID)>User getUser(uuid)Returns an User type object with information, if user with given uuid exists. If no user exists the method returns None.service=HistoryService(token)user=service.getUser(uuid)bool existsUser(uuid)Returns a bool, indicating if a user with given uuid exists. Returns false, if user doesn't exist.service=HistoryService(token)statement=service.existsUser(uuid)createUser(uuid)service=HistoryService(token)service.createUser(uuid)registerChanges(uuid, id, name)service=HistoryService(token)service.registerChanges(uuid,new_profile_id,new_profile_name)
Package: discord-variables-plugin
Discord Variables PluginA plugin to help with saving variables for botsInstalation:Windows:pip install discord_variables_pluginsLinux:pip3 install discord_variables_pluginsDocumentation:Server Specific Variables:Import package, and create discord_variables_plugin.ServerVariables object:importdiscord_variables_pluginserverVars=discord_variables_plugin.ServerVariables()To set a server specific variable# Pass a discord.Guild object for guild# Pass a string for varName# Pass any object for valueserverVars.set(guild,varName,value)To get a server specific variable# Pass a discord.Guild object for guild# Pass a string for varName# Returns the object stored in varName of guildvarNameValue=serverVars.get(guild,varName)To clear a saved server# Pass a discord.Guild object for guildserverVars.clearServer(guild)To remove a variable of a server# Pass a discord.Guild object for guild# Pass a string for varNameserverVars.removeVar(guild,varName)To save the server variables# Pass a file path as fpserverVars.save(fp)To load the server variables# Pass a file path as fpserverVars.load(fp)Global User Variables:Import package, and create discord_variables_plugin.GlobalUserVariables object:importdiscord_variables_pluginuserVars=discord_variables_plugin.GlobalUserVariables()To set a global user variable# Pass a discord.User object for user# Pass a string for varName# Pass any object for valueuserVars.set(user,varName,value)To get a global user variable# Pass a discord.User object for user# Pass a string for varName# Returns the object stored in varName of uservarNameValue=userVars.get(user,varName)To clear a saved user# Pass a discord.User object for useruserVars.clearUser(user)To remove a variable of a user# Pass a discord.User object for user# Pass a string for varNameuserVars.removeVar(user,varName)To save the global user variables# Pass a file path as fpuserVars.save(fp)To load the global user variables# Pass a file path as fpuserVars.load(fp)
Package: discord-verification-listener
A simple verification bot for discordSingle-guild discord-bot to give roles to a member accepting your servers rules.Also sending a neat little welcome message to the user.The bot also runs a task all five minutes to ensure that no member is missed due to potential downtime or other errors.It's possible to ignore members that joined before a specific date if the system shall not apply to older members.setuppip install -r requirements.txtexport TOKEN="your-key"python3 main.pyenv variablesparameterdescriptionexport ROLES="760434164146634752 880220270210740235"Roles to give after verification, separated by a spaceexport GUILD="760421261649248296"Guild the bot shall be set up forexport START_CHANNEL="877208002762002465"Channel the bot mentions in welcome messageexport PREFIX="b!"Command prefixexport CHECK_PERIOD="5"Time between two checks for missed membersexport NOT_BEFORE="25.08.2021"Members joined before that date won't be captured by verification check taskexport VERSION="unknown"Version the bot is runningexport OWNER_NAME="unknwon"Name of the bot ownerexport OWNER_ID="100000000000000000"ID of the bot ownerValuesGUILD,START_CHANNELandROLESneed to be changed in order to make the bot run on your server! Those default is only usable for our own discord.The shown values are the default values that will be loaded if nothing else is specified.Please note that the welcome message is in german, you can update it insrc/verification_listsner.py/get_welcome_text().