2018-08-05 22:20:37 +00:00
|
|
|
from itertools import zip_longest
|
2018-08-12 19:00:04 +00:00
|
|
|
|
2018-08-05 22:20:37 +00:00
|
|
|
|
|
|
|
def get_name(args):
|
|
|
|
if len(args) > 0:
|
|
|
|
name = ' '.join(args)
|
|
|
|
else:
|
|
|
|
name = None
|
|
|
|
|
|
|
|
return name
|
|
|
|
|
2018-08-11 23:02:50 +00:00
|
|
|
|
2018-08-30 16:46:20 +00:00
|
|
|
def get_nickname(discord_user, special_users):
|
2018-08-05 22:20:37 +00:00
|
|
|
if discord_user.nick is None:
|
|
|
|
name = discord_user.display_name
|
|
|
|
else:
|
|
|
|
name = discord_user.nick
|
|
|
|
|
2018-08-30 16:46:20 +00:00
|
|
|
if name in special_users:
|
|
|
|
return special_users[name]
|
2018-08-11 23:02:50 +00:00
|
|
|
else:
|
|
|
|
return name
|
2018-08-05 22:20:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
def get_args_dict(args):
|
|
|
|
if len(args) != 0:
|
|
|
|
return dict(zip_longest(*[iter(args)] * 2, fillvalue=" "))
|
|
|
|
else:
|
2018-08-11 23:02:50 +00:00
|
|
|
return {}
|