Skip to content

Commit

Permalink
Remove 'Yo Mama' jokes, fix status updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Daltz333 committed Jan 27, 2020
1 parent d989919 commit 658c6eb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 401 deletions.
10 changes: 3 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ repositories {
maven { url 'https://jitpack.io' }
}

compileJava {
options.compilerArgs << '-Xlint:deprecation'
}

dependencies {
compile 'net.dv8tion:JDA:4.0.0_39'
compile 'com.jagrosh:jda-utilities:3.0.1'
compile 'com.sedmelluq:lavaplayer:1.3.19'
compile 'net.dv8tion:JDA:4.1.1_103'
compile 'com.jagrosh:jda-utilities:3.0.2'
compile 'com.sedmelluq:lavaplayer:1.3.34'
compile 'com.github.taycaldwell:riot-api-java:4.3.0'
compile 'net.dean.jraw:JRAW:1.1.0'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.28.0'
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/Handlers/StatusUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import Constants.Configuration;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.Activity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.TimerTask;

Expand All @@ -14,12 +16,15 @@
public class StatusUpdater extends TimerTask {
private JDA jda;

private Logger logger = LoggerFactory.getLogger(Configuration.kLoggerName);

public StatusUpdater(JDA jda) {
this.jda = jda;
}

@Override
public void run() {
jda.getPresence().setActivity(Activity.playing(Configuration.kActivityText));
logger.info("Activity has been updated!");
}
}
7 changes: 6 additions & 1 deletion src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@
import java.sql.SQLException;
import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;

public class Main {
private static Logger logger = LoggerFactory.getLogger(Configuration.kLoggerName);

private static JDA jda;

private static Timer timer = new Timer();

public static void main(String[] args) {
try {
JsonLoader jsonLoader = new JsonLoader();
Expand Down Expand Up @@ -170,8 +173,10 @@ public static void main(String[] args) {

//loader our client and custom commands
jda.addEventListener(client, new DadBotCustomCommand(), new BotHelpCommand(client), new LeagueNewsCommand());
StatusUpdater updaterTask = new StatusUpdater(jda);
TimerTask updaterTask = new StatusUpdater(jda);

timer.schedule(updaterTask, 0, 3600000);

} catch (LoginException e) {
logger.error("Exception: ", e);
}
Expand Down
Loading

0 comments on commit 658c6eb

Please sign in to comment.