mirror of
https://github.com/System-End/nephthys.git
synced 2026-04-19 18:35:14 +00:00
run checks
This commit is contained in:
parent
71cd350a80
commit
2fb5fc8bde
6 changed files with 12 additions and 12 deletions
|
|
@ -15,12 +15,12 @@ async def channel_left(ack: AsyncAck, event: dict, client: AsyncWebClient):
|
|||
|
||||
users = await client.usergroups_users_list(usergroup=env.slack_user_group)
|
||||
new_users = users.get("users", [])
|
||||
|
||||
|
||||
try:
|
||||
new_users.remove(user_id)
|
||||
except ValueError:
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
await client.usergroups_users_update(
|
||||
usergroup=env.slack_user_group, users=new_users
|
||||
)
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@ class HelloWorld(Macro):
|
|||
text=f"hey, {name}! i'm heidi :rac_shy: say hi to orpheus for me would you? :rac_cute:",
|
||||
channel=env.slack_help_channel,
|
||||
thread_ts=ticket.msgTs,
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -29,4 +29,4 @@ class Resolve(Macro):
|
|||
f"Ticket with ts {ticket.msgTs} is already closed. No action taken. (Trying to resolve for <@{helper.slackId}>).",
|
||||
messages=[f"Ticket ID: {ticket.id}", f"Helper ID: {helper.id}"],
|
||||
)
|
||||
return
|
||||
return
|
||||
|
|
|
|||
|
|
@ -9,4 +9,4 @@ class Macro:
|
|||
"""
|
||||
Run the macro with the given arguments.
|
||||
"""
|
||||
raise NotImplementedError("Subclasses must implement this method.")
|
||||
raise NotImplementedError("Subclasses must implement this method.")
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ async def update_helpers():
|
|||
)
|
||||
|
||||
# create new users not in the db
|
||||
existing_users_in_db = await env.db.user.find_many(where={"slackId": {"in": team_ids}})
|
||||
existing_users_in_db = await env.db.user.find_many(
|
||||
where={"slackId": {"in": team_ids}}
|
||||
)
|
||||
existing_user_ids_in_db = {user.slackId for user in existing_users_in_db}
|
||||
|
||||
new_member_data_to_create = []
|
||||
|
|
|
|||
|
|
@ -30,11 +30,9 @@ async def get_manage_tags_view(user: User) -> dict:
|
|||
)
|
||||
if tag.userSubscriptions:
|
||||
subIds = [user.userId for user in tag.userSubscriptions]
|
||||
|
||||
subUsers = await env.db.user.find_many(
|
||||
where={"id": {"in": subIds}}
|
||||
)
|
||||
|
||||
|
||||
subUsers = await env.db.user.find_many(where={"id": {"in": subIds}})
|
||||
|
||||
subs = [user.slackId for user in subUsers]
|
||||
else:
|
||||
subs = []
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue