Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Make JDA Utils only set Activity when set. #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public CommandClientBuilder setEmojis(String success, String warning, String err

/**
* Sets the {@link net.dv8tion.jda.api.entities.Activity Game} to use when the bot is ready.
* <br>Can be set to {@code null} for no activity.
* <br>Can be set to {@code null} for JDA Utilities to not set it.
*
* @param activity
* The Game to use when the bot is ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,10 @@ private void onReady(ReadyEvent event)
return;
}
textPrefix = prefix.equals(DEFAULT_PREFIX) ? "@"+event.getJDA().getSelfUser().getName()+" " : prefix;
event.getJDA().getPresence().setPresence(status==null ? OnlineStatus.ONLINE : status,
activity ==null ? null : "default".equals(activity.getName()) ? Activity.playing("Type "+textPrefix+helpWord) : activity);

if(activity != null)
event.getJDA().getPresence().setPresence(status==null ? OnlineStatus.ONLINE : status,
"default".equals(activity.getName()) ? Activity.playing("Type "+textPrefix+helpWord) : activity);

// Start SettingsManager if necessary
GuildSettingsManager<?> manager = getSettingsManager();
Expand Down