I hereby claim:
- I am 182exe on github.
- I am 182exe (https://keybase.io/182exe) on keybase.
- I have a public key ASDldZMb4Yd0-wXz4fMFuhVIvMx06SOuCvFD5M1ClwDO8Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // thanks to gapple.pw for the very well made docs (https://mojang-api-docs.gapple.pw/) | |
| // thanks to wiki.vg for teaching me microsoft auth scheme (https://wiki.vg/Microsoft_Authentication_Scheme) | |
| const axios = require(`axios`) | |
| async function getUsernameAndUUID(bearerToken) { | |
| try { | |
| const url = 'https://api.minecraftservices.com/minecraft/profile'; | |
| const config = { | |
| headers: { |
| // use with @prismarinejs/mineflayer | |
| // if you don't know what a session token/access token is, don't bother with this; it's for the silliest of devs | |
| const mineflayer = require(`mineflayer`) | |
| const config = { | |
| host: `example.com`, | |
| port: 25565, | |
| token: `eyJraWQiOiJhYzg0YSIsImFsZyI6IkhTMjU2In0.eyJ4dWlkIjoiMjUzNTQ...` | |
| } |
| const axios = require('axios'); | |
| const url = `https://discord.com/api/webhooks/<webhookid>/<webhooktoken>` | |
| // initially post a message | |
| // "?wait=true" url param tells discord to return a message object so we can get the id of it | |
| axios.post(`${url}?wait=true`, { | |
| content: "hi, test. this is the first message." | |
| }).then((response) => { | |
| // use PATCH method to edit webhooks |
| /* | |
| simple colored console message prefixes | |
| Usage: | |
| const Loginator = require(`./loginator.js`) | |
| const logger = new Loginator(4, false, { | |
| "info": {fg: "brightblack", bg: "white"}, | |
| "chat": {fg: "white", bg: "brightblack"}, | |
| "warn": {fg: "brightwhite", bg: "yellow"}, | |
| "uhoh": {fg: "yellow", bg: "red"}, |
| function jibber(length, punctuate, punctuationMarks, wordLengthLimit, mimicEnglishPractices) { | |
| length = typeof length !== `undefined` ? length : 1; | |
| punctuate = typeof punctuate !== `undefined` ? punctuate : false; | |
| punctuationMarks = typeof punctuationMarks !== `undefined` ? punctuationMarks : [".", "!", "?", "..."]; | |
| const cv = 'aeiou'; | |
| const cc = 'bcdfghjklmnprstvw'; | |
| const ccx = 'qxzy'; | |
| const cca = 'bcdfghjklmnpqrstvwxyz' |