Version 3.1:
Updated multiple libraries. Updated JDA to use its alpha version and updated the code accordingly.
This commit is contained in:
@@ -8,7 +8,7 @@ import fr.Skydust.JdrBot.stock.Command;
|
||||
import fr.Skydust.JdrBot.utils.Utils;
|
||||
import net.dv8tion.jda.api.OnlineStatus;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.events.user.update.UserUpdateOnlineStatusEvent;
|
||||
|
||||
public class LastTimeOnline extends Command {
|
||||
@@ -21,19 +21,19 @@ public class LastTimeOnline extends Command {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void call(GuildMessageReceivedEvent e) {
|
||||
if(e.getMessage().getMentionedUsers().size() < 1) {
|
||||
public void call(MessageReceivedEvent e) {
|
||||
if(e.getMessage().getMentions().getUsers().size() < 1) {
|
||||
e.getChannel().sendMessage("Vous n'avez pas mentionne d'utilisateur !").queue();
|
||||
return;
|
||||
}
|
||||
User u = e.getMessage().getMentionedUsers().get(0);
|
||||
User u = e.getMessage().getMentions().getUsers().get(0);
|
||||
if(AllUsers.get(u.getIdLong()) == null) {
|
||||
e.getChannel().sendMessage(u.getAsMention()+" n'a pas change d'etat entre le demarrage du bot et maintenant").queue();
|
||||
return;
|
||||
}
|
||||
|
||||
OnlineStatus status = e.getGuild().getMember(u).getOnlineStatus();
|
||||
LocalDateTime UserDate = AllUsers.get(e.getMessage().getMentionedUsers().get(0).getIdLong());
|
||||
LocalDateTime UserDate = AllUsers.get(e.getMessage().getMentions().getUsers().get(0).getIdLong());
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if(status.equals(OnlineStatus.INVISIBLE) || status.equals(OnlineStatus.OFFLINE)) {
|
||||
|
||||
Reference in New Issue
Block a user