File tree Expand file tree Collapse file tree
application/src/main/java/org/togetherjava/tjbot/features/moderation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434import java .awt .Color ;
3535import java .time .Duration ;
3636import java .time .Instant ;
37+ import java .time .OffsetDateTime ;
38+ import java .time .ZoneOffset ;
39+ import java .time .temporal .ChronoUnit ;
3740import java .util .ArrayList ;
3841import java .util .List ;
3942import java .util .Objects ;
@@ -162,14 +165,16 @@ private Optional<TextChannel> findModAuditLogChannel(MessageContextInteractionEv
162165 private MessageCreateAction reportToMods (Message message , TextChannel auditChannel ) {
163166 User author = message .getAuthor ();
164167 String description = createDescription (message );
168+ long accountAgeDays = ChronoUnit .DAYS .between (author .getTimeCreated (),
169+ OffsetDateTime .now (ZoneOffset .UTC ));
165170
166171 MessageEmbed reportEmbed = new EmbedBuilder ().setTitle ("Is this Scam?" )
167172 .setDescription (
168173 MessageUtils .abbreviate (description , MessageEmbed .DESCRIPTION_MAX_LENGTH ))
169174 .setAuthor (author .getName (), null , author .getEffectiveAvatarUrl ())
170175 .setTimestamp (message .getTimeCreated ())
171176 .setColor (AMBIENT_COLOR )
172- .setFooter (author .getId ())
177+ .setFooter ("%s - account age %d days" . formatted ( author .getId (), accountAgeDays ))
173178 .build ();
174179
175180 long guildId = message .getGuild ().getIdLong ();
You can’t perform that action at this time.
0 commit comments