Fix expired coinflip channel id bug
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-11-21 11:19:23 +01:00
parent f73b489844
commit 083fef3911
2 changed files with 6 additions and 1 deletions

View File

@ -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();

View File

@ -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(