adding ingame chat support from sourcemod through java to python
This commit is contained in:
@@ -19,6 +19,8 @@ import FunctionLayer.DoStuff;
|
||||
import FunctionLayer.PipelineJMWESingleton;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.javacord.api.DiscordApi;
|
||||
@@ -29,6 +31,12 @@ import org.javacord.api.DiscordApiBuilder;
|
||||
* @author install1
|
||||
*/
|
||||
public class DiscordHandler {
|
||||
public static class update_autismo_ingame_msgs extends TimerTask {
|
||||
@Override
|
||||
public void run() {
|
||||
Datahandler.instance.update_autismo_mysql();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "15");
|
||||
@@ -48,6 +56,8 @@ public class DiscordHandler {
|
||||
Datahandler.instance.updateStringCache();
|
||||
String token = "NTI5NzAxNTk5NjAyMjc4NDAx.Dw0vDg.7-aMjVWdQMYPl8qVNyvTCPS5F_A";
|
||||
DiscordApi api = new DiscordApiBuilder().setToken(token).login().join();
|
||||
Timer timer = new Timer();
|
||||
timer.scheduleAtFixedRate(new update_autismo_ingame_msgs(), 700, 700);
|
||||
api.addMessageCreateListener(event -> {
|
||||
if (!FunctionLayer.DoStuff.isOccupied()) {
|
||||
FunctionLayer.DoStuff.doStuff(event, api);
|
||||
|
||||
Reference in New Issue
Block a user