uhhh so this is my code, I had to change a few names in the slash commands cus' the purpose of that command was um... a bit embarrassing.
import hikari
import lightbulb
import miru
bot = lightbulb.BotApp(token="nope stoopid", prefix="!")
class DiceView(miru.View):
@miru.button(label="yes", emoji="๐", style=hikari.ButtonStyle.SUCCESS)
async def btn_yes(self, button: miru.Button, ctx: miru.ViewContext) -> None:
await bot.rest.add_role_to_member(user=ctx.author, guild=ctx.guild_id, role=1111137057985789962)
await ctx.edit_response("You have been given a basement keycard.", components=[])
self.stop()
@miru.button(label="no", emoji="๐", style=hikari.ButtonStyle.DANGER)
async def btn_no(self, button: miru.Button, ctx: miru.ViewContext) -> None:
await ctx.edit_response("Very well.", components=[])
self.stop()
miru.install(bot)
@bot.command
@lightbulb.command("basement", "Oho, a secret?")
@lightbulb.implements(lightbulb.SlashCommand)
async def secret_stuff(ctx: lightbulb.Context, event=None) -> None:
"""Gives user access to stuff"""
if 1111137057985789962 in ctx.member.role_ids:
await ctx.respond("I believe you already have a basement keycard.")
else:
view = DiceView(timeout=30)
message = await ctx.respond("Ah, I see you wish to access the basement. Be warned, access to the basement is scary",
components=view.build(), flags=hikari.MessageFlag.EPHEMERAL)
message = await message
await view.start(message)
await view.wait()
print("All done.")
@bot.command
@lightbulb.option("message", "message to write", type=str)
@lightbulb.add_checks(lightbulb.checks.has_roles(1087936969297891388, 1088248323816837181, mode=any))
@lightbulb.command("writemessagerobonal", "Makes bot write a message")
@lightbulb.implements(lightbulb.SlashCommand)
async def write_message(ctx: lightbulb.Context) -> None:
message = ctx.options.message
await bot.rest.create_message(ctx.channel_id, message)
await ctx.respond("I have sent the message.", flags=hikari.MessageFlag.EPHEMERAL)
@bot.listen(lightbulb.CommandErrorEvent)
async def error_handler(event: lightbulb.CommandErrorEvent) -> None:
# Send user a check failure message
if isinstance(event.exception, lightbulb.errors.CheckFailure):
await event.context.respond(event.exception, flags=hikari.MessageFlag.EPHEMERAL)
return
# Re-raise any other error since this function can't deal with it
raise event.exception
bot.run(
activity=hikari.Activity(name="with stuff", type=hikari.ActivityType.PLAYING),
status=hikari.Status.ONLINE
)
Anyways, most of it's irrelevant, but I'm trying to host the bot on a google cloud vm, using debian. I've created a venv and am trying to run the code through that, but I keep encountering:
class DiceView(miru.View):
^^^^^^^^^
AttributeError: module 'miru' has no attribute 'View'```
so then I tried it on my own PC (which SHOULD also be using a venv maybe?), and the code runs fine there, but not on the VM so I'm absolutely lost.
```Package Version
----------------- ------------
aiohttp 3.9.3
aiosignal 1.3.1
alluka 0.1.4
attrs 23.2.0
colorlog 6.8.2
frozenlist 1.4.1
greenlet 3.0.3
hikari 2.0.0.dev122
hikari-lightbulb 2.3.5
hikari-miru 4.0.0
idna 3.6
multidict 6.0.5
pip 23.0.1
setuptools 66.1.1
SQLAlchemy 2.0.25
typing_extensions 4.9.0
urwid 2.5.1
yarl 1.9.4```
There's the package list, it should be right. Thank you for the help in advance.



