pass private Option from /book command to View

This commit is contained in:
Riley Housden 2022-08-20 01:28:51 -04:00
parent 05acd6e4b0
commit 6f3ebbd45d
Signed by: InValidFire
GPG key ID: 0D6208F6DF56B4D8

View file

@ -37,6 +37,7 @@ class BookingConfirmationView(miru.View):
await gcal.create_event(room.number, room.start_time, room.end_time) await gcal.create_event(room.number, room.start_time, room.end_time)
embed = hikari.Embed(title="Rooms Booked!") embed = hikari.Embed(title="Rooms Booked!")
add_rooms_to_embed(self.room_list, embed) add_rooms_to_embed(self.room_list, embed)
embed.set_image(self.image)
await ctx.edit_response(embed=embed, components=[]) await ctx.edit_response(embed=embed, components=[])
thread_embed = hikari.Embed(title="Rooms were booked!") thread_embed = hikari.Embed(title="Rooms were booked!")
@ -70,7 +71,8 @@ async def book(ctx: lightbulb.Context) -> None:
response.title = "Room Bookings" response.title = "Room Bookings"
response.description = "Are the booking(s) correct?" response.description = "Are the booking(s) correct?"
response.set_image(ctx.options.img) response.set_image(ctx.options.img)
view = BookingConfirmationView(room_list=room_list, image=ctx.options.img) view = BookingConfirmationView(
room_list=room_list, image=ctx.options.img, private=ctx.options.private)
resp = await ctx.respond(response, components=view.build()) resp = await ctx.respond(response, components=view.build())
view.start(await resp.message()) view.start(await resp.message())