Skip to content

Instantly share code, notes, and snippets.

View Useems's full-sized avatar
🐳

Marcos André Useems

🐳
View GitHub Profile
@Useems
Useems / bot
Created December 28, 2017 14:56
var Eris = require('eris');
var bot = new Eris("Mzk1NzMxNjI1MTIxNDE1MTY4.DSXJiQ.Zgm2qJPDVnRqSRI5hKQfLafN6dk");
console.log("Connecting...");
bot.on("ready", () =>{
console.log("Sucess");
});
bot.on("messageCreate", (msg) =>{
@Useems
Useems / index.ts
Created February 21, 2024 12:40
Facebook NodeJS encpass implementation
// @ts-ignore
import { default as nacl } from 'tweetnacl-sealedbox-js';
import { webcrypto } from 'crypto';
function decodeUTF8(str: string): Uint8Array {
if (typeof str !== "string")
throw new TypeError("expected string");
return new Uint8Array(unescape(encodeURIComponent(str)).split("").map(char => char.charCodeAt(0)));
}