Skip to content

Commit

Permalink
bin/darkirc: [taubot] replace id with ref_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Dastan-glitch committed Nov 19, 2023
1 parent 7598243 commit c793cfd
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions bin/darkirc/script/bots/taubot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
cmd = event['action']
if cmd == "add_task":
user = task['owner']
id = task['id']
refid = task['ref_id'][:6]
title = task['title']
assigned = ", ".join(task['assign'])

Expand All @@ -45,53 +45,53 @@
channel = args.alt_chan

if len(assigned) > 0:
notification = f"{user} added task ({id}): {title}. assigned to {assigned}"
notification = f"{user} added task ({refid}): {title}. assigned to {assigned}"
else:
notification = f"{user} added task ({id}): {title}"
notification = f"{user} added task ({refid}): {title}"
# print(notification)
ircc.send(channel, notification)
elif cmd == "state":
user = event['author']
state = event['content']
id = task['id']
refid = task['ref_id'][:6]
title = task['title']

project = task['project'] if task['project'] is not None else []
if args.skip in project or '+' + args.skip in task['tags'] or args.skip_workspace in task['workspace']:
channel = args.alt_chan

if state == "start":
notification = f"{user} started task ({id}): {title}"
notification = f"{user} started task ({refid}): {title}"
elif state == "pause":
notification = f"{user} paused task ({id}): {title}"
notification = f"{user} paused task ({refid}): {title}"
elif state == "stop":
notification = f"{user} stopped task ({id}): {title}"
notification = f"{user} stopped task ({refid}): {title}"
elif state == "cancel":
notification = f"{user} canceled task ({id}): {title}"
notification = f"{user} canceled task ({refid}): {title}"
# print(notification)
ircc.send(channel, notification)
elif cmd == "comment":
user = event['author']
id = task['id']
refid = task['ref_id'][:6]
title = task['title']

project = task['project'] if task['project'] is not None else []
if args.skip in project or '+' + args.skip in task['tags'] or args.skip_workspace in task['workspace']:
channel = args.alt_chan

notification = f"{user} commented on task ({id}): {title}"
notification = f"{user} commented on task ({refid}): {title}"
# print(notification)
ircc.send(channel, notification)
elif cmd == "assign":
user = event['author']
assignees = event['content']
id = task['id']
refid = task['ref_id'][:6]
title = task['title']

project = task['project'] if task['project'] is not None else []
if args.skip in project or '+' + args.skip in task['tags'] or args.skip_workspace in task['workspace']:
channel = args.alt_chan

notification = f"{user} reassigned task ({id}): {title} to {assignees}"
notification = f"{user} reassigned task ({refid}): {title} to {assignees}"
# print(notification)
ircc.send(channel, notification)

0 comments on commit c793cfd

Please sign in to comment.