Categories > Coding > Python >
[Release] Discord Bot w/ slash commands using Hikari
Posted
Greetings, dear community!
Today I come with a release of a Discord bot in Python, using the Hikari library. It's fast and efficient, and it's very easy to make slash commands with it. You can learn more here.
Download link: https://www.mediafire.com/file/1zvrm7e66xafift/hikari.py/file
Source:
import os
import hikari
import lightbulb
bot = lightbulb.BotApp(
token="YourTokenHere",
default_enabled_guilds=YOUR_GUILD_ID_HERE,
help_slash_command=True,
intents=hikari.Intents.ALL
)
@Bot.command()
@lightbulb.option("text", "What do you want the bot to say")
@lightbulb.command("say", "Make the bot say something")
@lightbulb.implements(lightbulb.SlashCommand)
async def cmd_say(ctx: lightbulb.SlashContext) -> None:
await ctx.respond(ctx.options.text)
bot.run()
Make sure to do
pip install hikari hikari-lightbulb
before running!
Random quote here...
Replied
Vouch! I may use that soon.
Cancel
Post
Replied
vouch cool /chars
Cancel
Post
Did I mention I use arch btw?
Replied
@Whoman JavaScript is pretty confusing for me, these intents and things... but I never said it's bad. I indeed code in itz although not everything like in Python.
Cancel
Post
Random quote here...
we are dead
Replied
@Alternate Discord.Py is pretty old and doesn't have latest updates, also Hikari is easier to use and better.
Cancel
Post
Random quote here...
we are dead
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post