#how in the world do i do this
1 messages · Page 1 of 1 (latest)
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "c:\Users\aytagg\Desktop\goofy_py_projects\discord_bot\commands\ping.py", line 9, in <module>
bot = lightbulb.BotApp(prefix=",")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BotApp.__init__() missing 1 required positional argument: 'token'```
import hikari
import lightbulb
from lightbulb import BotApp, Context, Command
from settings import prefix
from settings import token
import lightbulb
bot = lightbulb.BotApp(prefix=",")
@bot.command()
async def ping(ctx):
await ctx.respond(f"Pong! Latency: {bot.heartbeat_latency * 1000}ms")
bot.run(token)
what's unreadable, you need to pass a token to bot app lol.
not to run.
looks like ur trying to mix dpy with hikari
oke done i read docs
import hikari
import lightbulb
from settings import prefix, token
plugin = lightbulb.Plugin("ping")
intents = hikari.Intents.ALL
bot = lightbulb.BotApp(token=token)
@bot.command
@lightbulb.command("ping", "checks that the bot is alive")
@lightbulb.implements(lightbulb.PrefixCommand, lightbulb.SlashCommand)
async def baz(ctx: lightbulb.Context) -> None:
await ctx.respond("Pong!")
bot.run()
but how do i declare something as a prefix