slightly updated .time

This commit is contained in:
Toastie 2024-07-29 18:38:07 +12:00
parent 20e5bbac89
commit 586f5ba4b0
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
2 changed files with 8 additions and 26 deletions
src/EllieBot/Modules/Searches

View file

@ -98,24 +98,7 @@ public partial class Searches : EllieModule<SearchesService>
var (data, err) = await _service.GetTimeDataAsync(query);
if (err is not null)
{
LocStr errorKey;
switch (err)
{
case TimeErrors.ApiKeyMissing:
errorKey = strs.api_key_missing;
break;
case TimeErrors.InvalidInput:
errorKey = strs.invalid_input;
break;
case TimeErrors.NotFound:
errorKey = strs.not_found;
break;
default:
errorKey = strs.error_occured;
break;
}
await Response().Error(errorKey).SendAsync();
await HandleErrorAsync(err.Value);
return;
}
@ -479,8 +462,7 @@ public partial class Searches : EllieModule<SearchesService>
[RequireContext(ContextType.Guild)]
public async Task Avatar([Leftover] IGuildUser usr = null)
{
if (usr is null)
usr = (IGuildUser)ctx.User;
usr ??= (IGuildUser)ctx.User;
var avatarUrl = usr.RealAvatarUrl(2048);