Change IUser variable and parameter names to be less confusing (#149)
note: there are still instances of `IUser user` because I could not find a better name for them --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
d27168a89f
commit
2ab020a2b4
14 changed files with 245 additions and 251 deletions
|
@ -67,17 +67,17 @@ public class MessageDeletedResponder : IResponder<IMessageDelete>
|
|||
|
||||
var auditLog = auditLogPage.AuditLogEntries.Single();
|
||||
|
||||
var userResult = Result<IUser>.FromSuccess(message.Author);
|
||||
var deleterResult = Result<IUser>.FromSuccess(message.Author);
|
||||
if (auditLog.UserID is not null
|
||||
&& auditLog.Options.Value.ChannelID == gatewayEvent.ChannelID
|
||||
&& DateTimeOffset.UtcNow.Subtract(auditLog.ID.Timestamp).TotalSeconds <= 2)
|
||||
{
|
||||
userResult = await _userApi.GetUserAsync(auditLog.UserID.Value, ct);
|
||||
deleterResult = await _userApi.GetUserAsync(auditLog.UserID.Value, ct);
|
||||
}
|
||||
|
||||
if (!userResult.IsDefined(out var user))
|
||||
if (!deleterResult.IsDefined(out var deleter))
|
||||
{
|
||||
return Result.FromError(userResult);
|
||||
return Result.FromError(deleterResult);
|
||||
}
|
||||
|
||||
Messages.Culture = GuildSettings.Language.Get(cfg);
|
||||
|
@ -93,7 +93,7 @@ public class MessageDeletedResponder : IResponder<IMessageDelete>
|
|||
Messages.CachedMessageDeleted,
|
||||
message.Author.GetTag()), message.Author)
|
||||
.WithDescription(builder.ToString())
|
||||
.WithActionFooter(user)
|
||||
.WithActionFooter(deleter)
|
||||
.WithTimestamp(message.Timestamp)
|
||||
.WithColour(ColorsList.Red)
|
||||
.Build();
|
||||
|
|
Reference in a new issue