mirror of
https://github.com/MichaByte/OnBoard-Live.git
synced 2026-01-29 05:32:11 -05:00
add error handling to status command
This commit is contained in:
parent
25ad994ec0
commit
34a240ff9b
1 changed files with 30 additions and 25 deletions
|
|
@ -643,7 +643,7 @@ async def status_command(ack: AsyncAck, command):
|
|||
await ack()
|
||||
user_id = command["user_id"]
|
||||
channel_id = command["channel_id"]
|
||||
text = command["text"]
|
||||
try:
|
||||
db_user = await db.user.find_first_or_raise(where={"slack_id": user_id})
|
||||
user_stream_key = (
|
||||
await db.stream.find_first_or_raise(where={"user_id": db_user.id})
|
||||
|
|
@ -672,7 +672,12 @@ async def status_command(ack: AsyncAck, command):
|
|||
user=user_id,
|
||||
text=f"The server currently thinks you are {"live" if user_stream_key in [stream for stream in active_streams] else "not live"}! It looks like you've streamed for a total of {total_streamed} minutes. Here are all of your recordings: ```{all_recs}```"
|
||||
)
|
||||
|
||||
except Exception:
|
||||
await bolt.client.chat_postEphemeral(
|
||||
channel=channel_id,
|
||||
user=user_id,
|
||||
text=f"There was an error processing your request! Are you signed up for OnBoard Live yet? Message <@U05C64XMMHV> if this looks like a mistake!"
|
||||
)
|
||||
|
||||
@bolt.command("/onboard-live-submit")
|
||||
async def submit(ack: AsyncAck, command):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue