This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
html, body { | |
height: 100%; | |
overflow: hidden; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background: $background_color; | |
color: $text_color; | |
font-size: $font_size; | |
} | |
.colon, .name { | |
height: 0px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// modified from https://github.com/PvtTyphoon/lfm-rich-presence | |
const rpc = require("discord-rpc"); | |
const rp = new rpc.Client({ | |
transport: "ipc", | |
}); | |
const fetch = require("request-promise"); | |
const prettyMilliseconds = require("pretty-ms"); | |
function formatNumber(number) { | |
var x = number.split("."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadData(url){ | |
return new Promise((resolve, reject) => { | |
let xmlhttp = new XMLHttpRequest(); | |
xmlhttp.onreadystatechange = function(){ | |
if(xmlhttp.readyState === XMLHttpRequest.DONE){ | |
if(xmlhttp.status === 200){ | |
resolve(xmlhttp.responseText); | |
}else{ | |
reject(xmlhttp.status); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ab":{ | |
"name":"Abkhaz", | |
"nativeName":"аҧсуа" | |
}, | |
"aa":{ | |
"name":"Afar", | |
"nativeName":"Afaraf" | |
}, | |
"af":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getUserFromArguments = async (message, arguments) => { | |
if (!arguments) return null; | |
const userToFind = arguments.toLowerCase(); | |
if (message.mentions.users.first()) return message.mentions.users.first(); | |
if (!Number.isNaN(Number(userToFind))) { | |
const fetched = await message.client.users | |
.fetch(userToFind) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const startCollector = async (message, limit) => { | |
const filter = (m) => m.author.id === message.author.id; | |
const collector = await message.channel.awaitMessages({ | |
filter, | |
max: 1, | |
time: 30000, | |
}); | |
if (!collector.size) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Discord = require("discord.js"); | |
const splitMessage = (text, { maxLength = 2_000, char = "\n", prepend = "", append = "" } = {}) => { | |
text = Discord.Util.verifyString(text); | |
if (text.length <= maxLength) return [text]; | |
let splitText = [text]; | |
if (Array.isArray(char)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("colors"); | |
const { MessageActionRow, MessageButton } = require("discord.js"); | |
function Paginate( | |
client, | |
message, | |
pages, | |
page = 1, | |
options = { | |
time: 1000 * 60 * 3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphicsmagick from 'gm'; | |
export async function scaleImageToSize( | |
image: Buffer, | |
filename: string, | |
baseWidth: number, | |
baseHeight: number, | |
size: number, | |
): Promise<Buffer> { | |
let width = baseWidth; |
OlderNewer