it's a tool for adding things to crab rave
also available as a Telegram bot
brought to you by boringcactus
var Libhoney = require("libhoney"); var hny = new Libhoney({ writeKey: process.env.HONEYCOMB_KEY, dataset: "crabravebot" }) const { Composer } = require('micro-bot'); const child_process = require('child_process'); const fs = require('fs'); const url = require('url'); const { JSDOM } = require("jsdom"); // the bot const bot = new Composer(); // start command bot.command('/start', async ({ from, replyWithMarkdown, botInfo }) => replyWithMarkdown(`Hi *${from.first_name || from.username}*! To shitpost, type @${botInfo.username} and type the text you want to overlay over crab rave. This was originally made by @boringcactus in one afternoon when she was bored. This bot isn't super reliable but the source is at https://glitch.com/edit/#!/${process.env.PROJECT_DOMAIN}, and you can use this bot from the Web at https://${process.env.PROJECT_DOMAIN}.glitch.me/`)); // styles const STYLES = { 'classic': { 'video': 'https://cdn.glitch.com/70ea37b5-d264-46e5-a1db-29c786c86515%2FCrabRaveQuieter.mp4?v=1548223581701', 'thumb': 'https://cdn.glitch.com/70ea37b5-d264-46e5-a1db-29c786c86515%2FCrabRaveBackground.png?v=1566350372048', }, 'otamatone': { 'video': 'https://cdn.glitch.com/70ea37b5-d264-46e5-a1db-29c786c86515%2FCrabRaveOtamatone.mp4?v=1566354239409', 'thumb': 'https://cdn.glitch.com/70ea37b5-d264-46e5-a1db-29c786c86515%2FCrabRaveOtamatoneBackground.png?v=1566354702285', }, 'garfield': { 'video': 'https://cdn.glitch.com/70ea37b5-d264-46e5-a1db-29c786c86515%2FCrabRaveGarfield.mp4?v=1575143374116', 'thumb': 'https://cdn.glitch.com/70ea37b5-d264-46e5-a1db-29c786c86515%2FCrabRaveGarfieldBackground.png?v=1575143434563', }, } // inline query bot.on('inline_query', async ({ inlineQuery, answerInlineQuery }) => { const query = inlineQuery.query || ''; console.log('Got query', query); if (query.length > 1) { const result = [ { type: "video", id: "classic", video_url: "https://" + process.env.PROJECT_DOMAIN + ".glitch.me/video/" + encodeURIComponent(query) + ".mp4?v1", mime_type: "video/mp4", thumb_url: "https://" + process.env.PROJECT_DOMAIN + ".glitch.me/video/" + encodeURIComponent(query) + ".png?v1", title: 'Classic' }, { type: "video", id: "otamatone", video_url: "https://" + process.env.PROJECT_DOMAIN + ".glitch.me/video/" + encodeURIComponent(query) + ".mp4?v1&style=otamatone", mime_type: "video/mp4", thumb_url: "https://" + process.env.PROJECT_DOMAIN + ".glitch.me/video/" + encodeURIComponent(query) + ".png?v1&style=otamatone", title: 'Otamatone (original by TheRealSullyG)' }, { type: "video", id: "garfield", video_url: "https://" + process.env.PROJECT_DOMAIN + ".glitch.me/video/" + encodeURIComponent(query) + ".mp4?v1&style=garfield", mime_type: "video/mp4", thumb_url: "https://" + process.env.PROJECT_DOMAIN + ".glitch.me/video/" + encodeURIComponent(query) + ".png?v1&style=garfield", title: 'Garfield (original by @jondancesto)' }, ]; return answerInlineQuery(result); } }); function fixPaths() { for (let style of Object.keys(STYLES)) { try { let path = require('path').join('/tmp', style, 'video'); fs.mkdirSync(path, {recursive: true}); } catch (e) { console.log(e); } } } module.exports = { bot, server(req, res) { if (req.url === '/') { res.end(`
also available as a Telegram bot
brought to you by boringcactus