Skip to content

Instantly share code, notes, and snippets.

View DopeDealers's full-sized avatar
🥶

Phil - DopeDealers DopeDealers

🥶
View GitHub Profile
PROXY=false
download_server_jar() {
local prefix="https://papermc.io/api/v2/projects"
local project="paper"
if [ "$PROXY" = "true" ]; then
project="waterfall"
fi
@DopeDealers
DopeDealers / ActionBar.java
Created August 13, 2022 18:40
Dead simple way to send actionbars to your users in 1.19 mixed in with the color class i previously uploaded
public class ActionBar {
public void sendTitle(Audience target, String input) {
Component mainTitle = C.c(input);
Title title = Title.title(mainTitle, (Component)Component.empty());
target.showTitle(title);
}
public void sendSubtitle(Audience target, String input) {
Component subTitle = C.c(input);
@DopeDealers
DopeDealers / Color.java
Created August 13, 2022 18:34
A way to color Titlebars, ChatComponents like how you would back in the pre 1.18 versions
package your.class.your.packages;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
public class C {
public static Component c(String input) {
return (Component)LegacyComponentSerializer.legacy('&').deserialize(input);
}
}
@DopeDealers
DopeDealers / captcha.js
Created June 10, 2019 22:49
Captcha testing for discord.js
// works with discord.js.
// you can literally just prolly throw this into your commands folder with a folder called captcha in it
// and it would just work right off the bat.
// ~Phil
const svgCaptcha = require('svg-captcha');
const svgToImg = require("svg-to-img");
const fs = require('fs');
var captcha = svgCaptcha.create();
const Discord = require("discord.js");
const Enmap = require("enmap");
//const EnmapLevel = require("enmap-sqlite");
const client = new Discord.Client();
/*
usually i create the properties below such as settings in a guild create event
such as: client.settings.set(guild.id, {"mutedIds": [], "mutedRole": ""});
message.delete();
const msg = await message.channel.send("Ping?");
msg.edit(`Pong! Latency is ${msg.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ping)}ms`);