index.js
// If you want to forcibly re-send the same status, set 'd7dtdState.connStatus' to -100 first.
If you want to forcibly re-send the same status, set 'd7dtdState.connStatus' to -100 first.
If you want to forcibly re - send the same status set ' d7dtdState . connStatus ' to - 100 first .
function updateDiscordStatus(status) {
  if(!config["disable-status-updates"]) {
    if(status === 0 && d7dtdState.connStatus !== 0) {
      client.user.setPresence({ 
        activities: [{ name: `Connecting... | Type ${prefix}info` }],
        status: "dnd"
      });
    } else if(status === -1 && d7dtdState.connStatus !== -1) {
      client.user.setPresence({ 
        activities: [{ name: `Error | Type ${prefix}help` }],
        status: "dnd"
      });
    } else if(status === 1 && d7dtdState.connStatus !== 1) {
      if(typeof config.channel === "undefined" || config.channel === "channelid") {
        client.user.setPresence({ 
          activities: [{ name: `No channel | Type ${prefix}setchannel` }],
          status: "idle"
        });
      }
      else {
        client.user.setPresence({ 
          activities: [{ name: `7DTD | Type ${prefix}help` }],
          status: "online"
        });
      }
    }
    d7dtdState.connStatus = status;
  }
}
function updateDiscordStatus ( status ) { if ( ! config [ "disable-status-updates" ] ) { if ( status === 0 && d7dtdState . connStatus !== 0 ) { client . user . setPresence ( { activities : [ { name : ` ${ prefix } ` } ] , status : "dnd" } ) ; } else if ( status === - 1 && d7dtdState . connStatus !== - 1 ) { client . user . setPresence ( { activities : [ { name : ` ${ prefix } ` } ] , status : "dnd" } ) ; } else if ( status === 1 && d7dtdState . connStatus !== 1 ) { if ( typeof config . channel === "undefined" || config . channel === "channelid" ) { client . user . setPresence ( { activities : [ { name : ` ${ prefix } ` } ] , status : "idle" } ) ; } else { client . user . setPresence ( { activities : [ { name : ` ${ prefix } ` } ] , status : "online" } ) ; } } d7dtdState . connStatus = status ; } }
If you want to forcibly re-send the same status, set 'd7dtdState.connStatus' to -100 first.
If you want to forcibly re - send the same status set ' d7dtdState . connStatus ' to - 100 first .
// Update the status so we don't keep sending duplicates to Discord