use of com.github.jonteohr.tejbz.PropertyHandler in project pgda by jonteohr.
the class Schedule method sendSchedule.
public static void sendSchedule(InteractionHook hook) {
PropertyHandler prop = new PropertyHandler();
EmbedBuilder msg = new EmbedBuilder();
msg.setAuthor("PGDA", null, App.authorImage);
msg.setColor(App.color);
msg.setTitle("This weeks schedule");
msg.setImage(prop.getPropertyValue("schedule_url"));
hook.sendMessageEmbeds(msg.build()).queue();
}
use of com.github.jonteohr.tejbz.PropertyHandler in project pgda by jonteohr.
the class AutoMessage method autoMessageTimer.
public static void autoMessageTimer() {
Timer timer = new Timer();
AutoMessageSQL sql = new AutoMessageSQL();
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
if (count < sql.getInterval())
return;
String message = autoMessages.get(pagination);
if (message.contains("[video]")) {
PropertyHandler props = new PropertyHandler();
message = message.replace("[video]", props.getPropertyValue("recent_video"));
}
Twitch.twitchClient.getChat().sendMessage("tejbz", message);
count = 0;
if (pagination == (autoMessages.size() - 1))
pagination = 0;
else
pagination++;
}
}, 7 * 60 * 1000, 7 * 60 * 1000);
}
use of com.github.jonteohr.tejbz.PropertyHandler in project pgda by jonteohr.
the class Video method sendVideo.
public static void sendVideo(SlashCommandInteractionEvent e, InteractionHook hook) {
PropertyHandler prop = new PropertyHandler();
String url = prop.getPropertyValue("recent_video");
hook.sendMessage(e.getMember().getAsMention() + " Check out the latest video on the YouTube channel!\n" + url).queue();
}
Aggregations