Package: dispike
dispike⚙️  A simple to use, powerful framework for creating stateless, independent bots usingDiscord Slash Commands.⚡ Powered byFastAPI.📦 InstallationLatest stable-versionpip install dispike📚 Learn moreRead documentationhereSee an example bothereJoin our Discord Serverhere🧑‍💻 Quick Start ExamplesBasicfromdispikeimportDispike,DiscordCommand,DiscordResponsefromdispikeimportIncomingDiscordSlashInteractionfromdispike.helperimportEmbedbot=Dispike(...)command=DiscordCommand(name="stock",description="Get the latest active stocks in the market!")@bot.on("stock")asyncdefhandle_stock_request(stockticker:str,ctx:IncomingDiscordSlashInteraction)->DiscordResponse:get_price=function(stockticker...)embed=Embed()embed.add_field(name="Stock Price for{stockticker}.",value="Current price is{get_price}",inline=True)embed.set_footer(text="Request received by{ctx.member.user.username}")returnDiscordResponse(embed=embed)if__name__=="__main__":bot.register(command)bot.run()Advancedimportdispikefromdispikeimportinteractions,DiscordCommand,DiscordResponsefromdispikeimportIncomingDiscordSlashInteractionfromdispike.helperimportEmbedclassSampleGroupCollection(interactions.EventCollection):def__init__(self):self._api_key="..."defcommand_schemas(self):return[DiscordCommand(name="lateststocks",description="Get the highest performing stocks in the market currently!"),interactions.PerCommandRegistrationSettings(schema=DiscordCommand(name="price",description="return ticker price for server",options=[],),guild_id=11111111,)]defget_stock_information(self,stock_ticker):return...defget_portfolio_stats(self,user_id):return...@interactions.on("lateststocks")asyncdeflatest_stocks(self,ctx:IncomingDiscordSlashInteraction)->DiscordResponse:embed=Embed()# check user's porfolio by looking in the database by their discord IDportfolio_stats=self.get_portfolio_stats(ctx.member.user.id)embed.add_field(name="Stocks are doing good!",value=f"Current portfolio is{portfolio_stats}",inline=True)embed.set_footer(text="Request received by{ctx.member.user.username}")returnDiscordResponse(embeds=[embed])@interactions.on("price")asyncdefget_stock_price(self,ctx:IncomingDiscordSlashInteraction,ticker:str)->DiscordResponse:embed=Embed()embed.add_field(name=f"Stock Price for 1.",value=f"Current price is{self.get_stock_information(ticker)}",inline=True)embed.set_footer(text="Request received by{ctx.member.user.username}")returnDiscordResponse(embeds=[embed])## Inside seperate filefromdispikeimportDispike,DiscordCommandbot=Dispike(...)bot.register_collection(SampleGroupCollection(),register_command_with_discord=True)if__name__=="__main__":bot.run(port=5000)Discord API CoverageView CoverageAPI EndpointImplementationGet Global Application Commands✅ ImplementedCreate Global Application Command✅ ImplementedEdit Global Application Command✅ ImplementedDelete Global Application Command✅ ImplementedCreate Guild Application Command✅ ImplementedEdit Guild Application Command✅ ImplementedDelete Guild Application Command✅ ImplementedCreate Interaction Response✅ ImplementedEdit Original Interaction Response✅ ImplementedDelete Original Interaction Response✅ ImplementedCreate Followup Message✅ ImplementedEdit Followup Message✅ ImplementedDelete Followup Message✅ ImplementedData Models and Types✅ ImplementedApplicationCommand✅ ImplementedApplicationCommandOption✅ ImplementedApplicationCommandOptionType✅ ImplementedApplicationCommandOptionChoice✅ ImplementedInteraction✅ ImplementedInteraction Response✅ ImplementedMessage Components✅ ImplementedButtons (Message Components)✅ ImplementedAction Rows (Message Components)✅ ImplementedMessage Select (Message Components)✅ Implementedℹ️ NoticePython 3.6+Does not speak over the discord gateway.discord-py-slash-command is what you are looking for..You will need a server to accept connections directly from discord!🧑‍💻 DevelopmentHelp is wanted in mantaining this library. Please try to direct PRs to thedevbranch, and use black formatting (if possible).🎉 Special ThanksSquidtoon99marshmallow