Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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