Add support for attachments in message logger
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
7d068892e2
commit
00e30bd073
@ -1,5 +1,6 @@
|
|||||||
package wtf.beatrice.hidekobot.listeners;
|
package wtf.beatrice.hidekobot.listeners;
|
||||||
|
|
||||||
|
import net.dv8tion.jda.api.entities.Message;
|
||||||
import net.dv8tion.jda.api.entities.PrivateChannel;
|
import net.dv8tion.jda.api.entities.PrivateChannel;
|
||||||
import net.dv8tion.jda.api.entities.TextChannel;
|
import net.dv8tion.jda.api.entities.TextChannel;
|
||||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
@ -43,5 +44,13 @@ public class MessageLogger extends ListenerAdapter
|
|||||||
.replace("%message%", message);
|
.replace("%message%", message);
|
||||||
|
|
||||||
logger.log(toLog);
|
logger.log(toLog);
|
||||||
|
|
||||||
|
if(!event.getMessage().getAttachments().isEmpty())
|
||||||
|
{
|
||||||
|
for(Message.Attachment atch : event.getMessage().getAttachments())
|
||||||
|
{
|
||||||
|
logger.log(atch.getUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user