Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def announce_shift(bot, channel, rotation):
"""Anounces a shift and sets the topic to reflect that change"""
debug(bot,
'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))
hashline = formatting.color('###', formatting.colors.RED)
lead = formatting.color(' Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
formatting.colors.RED)
secondary = formatting.color(' Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
formatting.colors.RED)
oncall = formatting.color(' On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
formatting.colors.RED)
oncallWeeday = formatting.color(' No oncall scheduled on weekdays, contact shift lead',
formatting.colors.RED)
if bot.db.get_channel_value(channel, 'announce'):
print("Annoucing to channel " + str(channel))
bot.say(hashline, channel)
bot.say(lead, channel)
bot.say(secondary, channel)
if rotation['Oncall']:
bot.say(oncall, channel)
else:
def announce_shift(bot, channel, rotation):
"""Anounces a shift and sets the topic to reflect that change"""
debug(bot,
'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))
hashline = formatting.color('###', formatting.colors.RED)
lead = formatting.color(' Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
formatting.colors.RED)
secondary = formatting.color(' Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
formatting.colors.RED)
oncall = formatting.color(' On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
formatting.colors.RED)
oncallWeeday = formatting.color(' No oncall scheduled on weekdays, contact shift lead',
formatting.colors.RED)
if bot.db.get_channel_value(channel, 'announce'):
print("Annoucing to channel " + str(channel))
bot.say(hashline, channel)
bot.say(lead, channel)
bot.say(secondary, channel)
if rotation['Oncall']:
bot.say(oncall, channel)
def announce_shift(bot, channel, rotation):
"""Anounces a shift and sets the topic to reflect that change"""
debug(bot,
'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))
hashline = formatting.color('###', formatting.colors.RED)
lead = formatting.color(' Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
formatting.colors.RED)
secondary = formatting.color(' Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
formatting.colors.RED)
oncall = formatting.color(' On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
formatting.colors.RED)
oncallWeeday = formatting.color(' No oncall scheduled on weekdays, contact shift lead',
formatting.colors.RED)
if bot.db.get_channel_value(channel, 'announce'):
print("Annoucing to channel " + str(channel))
bot.say(hashline, channel)
bot.say(lead, channel)
bot.say(secondary, channel)
if rotation['Oncall']:
bot.say(oncall, channel)
else:
bot.say(oncallWeeday, channel)
else:
print("Failed to get channel value")
def announce_shift(bot, channel, rotation):
"""Anounces a shift and sets the topic to reflect that change"""
debug(bot,
'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))
hashline = formatting.color('###', formatting.colors.RED)
lead = formatting.color(' Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
formatting.colors.RED)
secondary = formatting.color(' Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
formatting.colors.RED)
oncall = formatting.color(' On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
formatting.colors.RED)
oncallWeeday = formatting.color(' No oncall scheduled on weekdays, contact shift lead',
formatting.colors.RED)
if bot.db.get_channel_value(channel, 'announce'):
print("Annoucing to channel " + str(channel))
bot.say(hashline, channel)
bot.say(lead, channel)
bot.say(secondary, channel)
if rotation['Oncall']:
bot.say(oncall, channel)
else:
bot.say(oncallWeeday, channel)
else:
print("Failed to get channel value")
def announce_shift(bot, channel, rotation):
"""Anounces a shift and sets the topic to reflect that change"""
debug(bot,
'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))
hashline = formatting.color('###', formatting.colors.RED)
lead = formatting.color(' Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
formatting.colors.RED)
secondary = formatting.color(' Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
formatting.colors.RED)
oncall = formatting.color(' On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
formatting.colors.RED)
oncallWeeday = formatting.color(' No oncall scheduled on weekdays, contact shift lead',
formatting.colors.RED)
if bot.db.get_channel_value(channel, 'announce'):
print("Annoucing to channel " + str(channel))
bot.say(hashline, channel)
bot.say(lead, channel)
bot.say(secondary, channel)
if rotation['Oncall']:
bot.say(oncall, channel)
else:
bot.say(oncallWeeday, channel)
else: