mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-10-25 11:06:45 -05:00
Connect to Discord and show connected user when not sending an activity
This commit is contained in:
@@ -79,8 +79,9 @@ class ZncDiscordPresenceClient {
|
||||
|
||||
if (this.m.presence_enabled && this.m.discord_preconnect) {
|
||||
if (this.rpc) {
|
||||
debugDiscord('No presence but Discord preconnect enabled - clearing Discord activity');
|
||||
if (this.title) debugDiscord('No presence but Discord preconnect enabled - clearing Discord activity');
|
||||
this.setActivity(this.rpc.id);
|
||||
this.title = null;
|
||||
} else {
|
||||
debugDiscord('No presence but Discord preconnect enabled - connecting');
|
||||
const discordpresence = getInactiveDiscordPresence(PresenceState.OFFLINE, 0);
|
||||
@@ -235,7 +236,8 @@ class ZncDiscordPresenceClient {
|
||||
if (!this.rpc) {
|
||||
this.connect(client_id, this.m.discord_client_filter);
|
||||
} else {
|
||||
this.rpc.client.setActivity(typeof activity === 'string' ? undefined : activity.activity);
|
||||
if (typeof activity === 'string') this.rpc.client.clearActivity();
|
||||
else this.rpc.client.setActivity(activity.activity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user