Fix expired coinflip channel id bug
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f73b489844
commit
083fef3911
@ -62,7 +62,7 @@ public class CoinFlipCommand
|
|||||||
private void trackAndRestrict(Message replyMessage, User user)
|
private void trackAndRestrict(Message replyMessage, User user)
|
||||||
{
|
{
|
||||||
String replyMessageId = replyMessage.getId();
|
String replyMessageId = replyMessage.getId();
|
||||||
String replyChannelId = replyMessage.getId();
|
String replyChannelId = replyMessage.getChannel().getId();
|
||||||
String replyGuildId = replyMessage.getGuild().getId();
|
String replyGuildId = replyMessage.getGuild().getId();
|
||||||
String userId = user.getId();
|
String userId = user.getId();
|
||||||
|
|
||||||
|
@ -43,6 +43,9 @@ public class ExpiredMessageRunner implements Runnable {
|
|||||||
|
|
||||||
for(String messageId : expiringMessages)
|
for(String messageId : expiringMessages)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(Configuration.isVerbose()) logger.log("expired check: " + messageId);
|
||||||
|
|
||||||
String expiryTimestamp = databaseManager.getQueuedExpiringMessageExpiryDate(messageId);
|
String expiryTimestamp = databaseManager.getQueuedExpiringMessageExpiryDate(messageId);
|
||||||
if(expiryTimestamp == null || expiryTimestamp.equals("")) continue; //todo: idk count it as expired already?
|
if(expiryTimestamp == null || expiryTimestamp.equals("")) continue; //todo: idk count it as expired already?
|
||||||
|
|
||||||
@ -50,6 +53,7 @@ public class ExpiredMessageRunner implements Runnable {
|
|||||||
LocalDateTime expiryDate = LocalDateTime.parse(expiryTimestamp, formatter);
|
LocalDateTime expiryDate = LocalDateTime.parse(expiryTimestamp, formatter);
|
||||||
if(now.isAfter(expiryDate))
|
if(now.isAfter(expiryDate))
|
||||||
{
|
{
|
||||||
|
if(Configuration.isVerbose()) logger.log("expired: " + messageId);
|
||||||
disableExpired(messageId);
|
disableExpired(messageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,6 +77,7 @@ public class ExpiredMessageRunner implements Runnable {
|
|||||||
RestAction<Message> retrieveAction = textChannel.retrieveMessageById(messageId);
|
RestAction<Message> retrieveAction = textChannel.retrieveMessageById(messageId);
|
||||||
|
|
||||||
|
|
||||||
|
if(Configuration.isVerbose()) logger.log("cleaning up: " + messageId);
|
||||||
|
|
||||||
retrieveAction.queue(
|
retrieveAction.queue(
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user