@Override public int hashCode() { return Long.hashCode(getJDA().getSelfUser().getIdLong()); }
if (authorId == getJDA().getSelfUser().getIdLong()) user = getJDA().getSelfUser(); else
groupUsers.put(getJDA().getSelfUser().getIdLong(), getJDA().getSelfUser()); for (int i = 0; i < recipients.length(); i++)
priv.setCurrentCall(call); callUsers.put(priv.getUser().getIdLong(), new CallUserImpl(call, priv.getUser())); callUsers.put(getJDA().getSelfUser().getIdLong(), new CallUserImpl(call, getJDA().getSelfUser()));
if (userId == getJDA().getSelfUser().getIdLong()) if (userId != getJDA().getSelfUser().getIdLong() // don't remove selfUser from cache && getJDA().getGuildMap().valueCollection().stream().noneMatch(g -> ((GuildImpl) g).getMembersMap().containsKey(userId)) && !(getJDA().getAccountType() == AccountType.CLIENT && getJDA().asClient().getFriendById(userId) != null))
priv.setCurrentCall(null); getJDA().asClient().getCallUserMap().remove(priv.getUser().getIdLong()); getJDA().asClient().getCallUserMap().remove(getJDA().getSelfUser().getIdLong());
long selfId = getJDA().getSelfUser().getIdLong(); memberIds.forEach(memberId ->
public void initOnce() { CBanks.init(getJda().getSelfUser().getIdLong(), getJda().getSelfUser().getName()); } }
void initializeBotOwner() { if (botOwner == 0L) { if (jda.getAccountType() == AccountType.BOT) { botOwner = jda.asBot().getApplicationInfo().complete().getOwner().getIdLong(); } else { botOwner = jda.getSelfUser().getIdLong(); } } }
private void onGuildBan(GuildBanEvent event, @Nonnull GuildWrapper wrapper) { if (cannotHandle(wrapper, ModlogEvent.USER_BANNED)) return; event.getGuild().getAuditLogs().limit(1).type(ActionType.BAN).queue(auditLogEntries -> { AuditLogEntry entry = auditLogEntries.get(0); // We don't want dupes. if (entry.getUser().getIdLong() == FlareBot.instance().getClient().getSelfUser().getIdLong()) return; boolean validEntry = entry.getTargetId().equals(event.getUser().getId()); ModlogHandler.getInstance().postToModlog(wrapper, ModlogEvent.USER_BANNED, event.getUser(), validEntry ? entry.getUser() : null, validEntry ? entry.getReason() : null); }); }
if (entry.getUser().getIdLong() == FlareBot.instance().getClient().getSelfUser().getIdLong()) return;
@Override public void onGuildVoiceLeave(GuildVoiceLeaveEvent event) { if (event.getMember().getUser().getIdLong() == event.getJDA().getSelfUser().getIdLong()) { if (flareBot.getMusicManager().hasPlayer(event.getGuild().getId())) { flareBot.getMusicManager().getPlayer(event.getGuild().getId()).setPaused(true); } if (Getters.getActiveVoiceChannels() == 0 && FlareBot.NOVOICE_UPDATING.get()) { Constants.getImportantLogChannel() .sendMessage("I am now updating, there are no voice channels active!").queue(); UpdateCommand.update(true, null); } } else { handleVoiceConnectivity(event.getChannelLeft()); } if (event.getMember().getUser().equals(event.getJDA().getSelfUser())) return; if (VoteUtil.contains(SkipCommand.getSkipUUID(), event.getGuild()) && event.getChannelLeft().getIdLong() == event.getGuild().getSelfMember().getVoiceState().getChannel().getIdLong()) { VoteUtil.getVoteGroup(SkipCommand.getSkipUUID(), event.getGuild()).remoreAllowedUser(event.getMember().getUser()); } }
@Override public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) { boolean songMessage = message.getAuthor().getIdLong() == Getters.getSelfUser().getIdLong(); PlayerManager musicManager = FlareBot.instance().getMusicManager(); if (!channel.getGuild().getAudioManager().isConnected() ||
if (target != null && target.getIdLong() == FlareBot.instance().getClient().getSelfUser().getIdLong()) { if (modAction == ModAction.UNBAN || modAction == ModAction.UNMUTE) MessageUtils.sendWarningMessage("W-why would you want to do that in the first place. Meanie :(", channel);