Skip to content

Commit 289d464

Browse files
author
Paul Philion
committed
fixing bug assigning color to unknown status or tracker
1 parent 697704d commit 289d464

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

netbot/formatting.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def get_emoji(key:str) -> str:
5050
'Urgent': discord.Color.dark_gold(),
5151
'Immediate': discord.Color.red(),
5252
'EPIC': discord.Color.dark_gray(),
53+
'Backburner': discord.Color.light_gray(),
54+
'Standing': discord.Color.light_gray(),
5355
}
5456

5557

@@ -328,11 +330,13 @@ def format_roles_alert(self, role_ids: set[int], msg: str) -> str:
328330

329331
def ticket_color(self, ticket:Ticket) -> discord.Color:
330332
"""Get the default color associtated with a priority"""
333+
default_color = discord.Color.light_gray()
334+
331335
if ticket.status.is_closed:
332336
# return the status color:
333-
return COLOR[ticket.status.name]
337+
return COLOR.get(ticket.status.name, default_color)
334338
else:
335-
return COLOR[ticket.priority.name]
339+
return COLOR.get(ticket.priority.name, default_color)
336340

337341

338342
def lookup_discord_user(self, ctx: discord.ApplicationContext, name:str) -> discord.Member:

0 commit comments

Comments
 (0)