release-1.0.0
DustyP 8 years ago
parent 352470e364
commit 02f189781f

@ -463,7 +463,6 @@ class Utils:
@commands.cooldown(1, 3, type=commands.BucketType.user) @commands.cooldown(1, 3, type=commands.BucketType.user)
async def get_time_in_timezone(self, ctx, timezone: str='US/Eastern', *, time: str=None): async def get_time_in_timezone(self, ctx, timezone: str='US/Eastern', *, time: str=None):
em = discord.Embed() em = discord.Embed()
description = ''
if time is None: if time is None:
em.set_footer(text='Time not given... using current UTC time.') em.set_footer(text='Time not given... using current UTC time.')
@ -472,9 +471,7 @@ class Utils:
try: try:
orig_time = copy(time) orig_time = copy(time)
for tz in pytz.all_timezones: for tz in pytz.all_timezones:
if any([t.replace(' ', '_') in tz.lower() if time.lower().split()[-1] in tz.lower():
or t.replace(' ', '-') in tz.lower()
for t in time.lower().split()]):
time = utils.replace_text_ignorecase(time, old=tz, new='') time = utils.replace_text_ignorecase(time, old=tz, new='')
if tz in replace_tzs: if tz in replace_tzs:
tz = replace_tzs['tz'] tz = replace_tzs['tz']
@ -488,7 +485,7 @@ class Utils:
except ValueError: except ValueError:
em.title = 'Can\' parse time.' em.title = 'Can\' parse time.'
em.description = f'For some reason I can\'t parse this time string: \n' \ em.description = f'For some reason I can\'t parse this time string: \n' \
f'{orig_time} {time} {parsed_tz}' \ f'{orig_time} {time} {parsed_tz}\n' \
f'Examples of valid time strings are in my help documentation.\n' \ f'Examples of valid time strings are in my help documentation.\n' \
f'Please try again.' f'Please try again.'
em.colour = discord.Colour.red() em.colour = discord.Colour.red()

Loading…
Cancel
Save