fixed rounding errors in mentions and channels for reminders
This commit is contained in:
parent
373809384f
commit
d2d6b7824f
|
@ -21,10 +21,10 @@ namespace DeukBot4.Database
|
||||||
db.SortedSetAddAsync("deukbot_reminders", (RedisValue)id, expectedTime.ToBinary());
|
db.SortedSetAddAsync("deukbot_reminders", (RedisValue)id, expectedTime.ToBinary());
|
||||||
db.HashSetAsync((RedisKey) id, new[]
|
db.HashSetAsync((RedisKey) id, new[]
|
||||||
{
|
{
|
||||||
new HashEntry("channel", channel),
|
new HashEntry("channel", channel.ToString()),
|
||||||
new HashEntry("message", message),
|
new HashEntry("message", message),
|
||||||
new HashEntry("author", author),
|
new HashEntry("author", author.ToString()),
|
||||||
new HashEntry("recipient", recipient),
|
new HashEntry("recipient", recipient.ToString()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -52,10 +52,10 @@ namespace DeukBot4.Database
|
||||||
string message = null;
|
string message = null;
|
||||||
foreach (var hashEntry in data)
|
foreach (var hashEntry in data)
|
||||||
{
|
{
|
||||||
if (hashEntry.Name == "channel") channel = (ulong) hashEntry.Value;
|
if (hashEntry.Name == "channel") channel = ulong.Parse(hashEntry.Value);
|
||||||
else if (hashEntry.Name == "message") message = hashEntry.Value;
|
else if (hashEntry.Name == "message") message = hashEntry.Value;
|
||||||
else if (hashEntry.Name == "author") author = (ulong) hashEntry.Value;
|
else if (hashEntry.Name == "author") author = ulong.Parse(hashEntry.Value);
|
||||||
else if (hashEntry.Name == "recipient") recipient = (ulong) hashEntry.Value;
|
else if (hashEntry.Name == "recipient") recipient = ulong.Parse(hashEntry.Value);
|
||||||
}
|
}
|
||||||
var diff = time - DateTime.UtcNow;
|
var diff = time - DateTime.UtcNow;
|
||||||
FireReminderAtTime((int) diff.TotalSeconds, channel, message, author, recipient);
|
FireReminderAtTime((int) diff.TotalSeconds, channel, message, author, recipient);
|
||||||
|
|
Loading…
Reference in New Issue