Skip to content

Instantly share code, notes, and snippets.

View Hopefuls's full-sized avatar
:shipit:
Motivation go woosh

Aurel Hopefuls

:shipit:
Motivation go woosh
View GitHub Profile
@Hopefuls
Hopefuls / Main.java
Created March 25, 2021 17:48
Basic Example of implementing a ping command using the CommandHandler
package me.hopedev.testproj;
import me.hopedev.commandhandler.CommandBuilder;
import org.javacord.api.DiscordApi;
import org.javacord.api.DiscordApiBuilder;
public class Main {
public static void main(String[] args) {
package me.hopedev.hopeutils.requesting;
import com.squareup.okhttp.*;
public class MakeRequest {
private final String URL;
public static OkHttpClient client = new OkHttpClient();
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
@Hopefuls
Hopefuls / webhooking_GitHubContext.java
Created March 5, 2021 02:10
Things for github webhooks, done for Javacord
package org.normies.pepegalog.webhooking;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import org.javacord.api.entity.channel.ServerTextChannel;
import org.json.JSONObject;
import org.normies.pepegalog.Main;
import org.normies.pepegalog.utils.RequestManager;
import org.normies.pepegalog.utils.ResponseManager;
@Hopefuls
Hopefuls / Query.java
Created March 5, 2021 02:06
Requesting Managers for HttpServer based things
package org.normies.pepegalog.utils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class Query {
private final String query;
@Hopefuls
Hopefuls / GitHubContext.java
Last active March 5, 2021 02:02
Template for my GitHub webhook
public class GitHubContext implements HttpHandler {
@Override
public void handle(HttpExchange exchange) throws IOException {
RequestManager requestManager = new RequestManager(exchange);
ResponseManager responseManager = new ResponseManager(exchange);
System.out.println("Received!! hello!");
JSONObject object = requestManager.asJson();