good girl

This commit is contained in:
Lea 2023-07-28 15:43:24 +02:00
parent dba54536a1
commit 9e4e891808
3 changed files with 24 additions and 4 deletions

View file

@ -6,7 +6,7 @@
"module": "node16", "module": "node16",
"exports": "./index.js", "exports": "./index.js",
"scripts": { "scripts": {
"build": "rm -rf dist && tsc", "build": "rm -rf dist/index.js && tsc",
"start": "node --experimental-specifier-resolution=node dist/index", "start": "node --experimental-specifier-resolution=node dist/index",
"dev": "yarn build && yarn start" "dev": "yarn build && yarn start"
}, },

View file

@ -3,7 +3,8 @@ import { config } from 'dotenv';
import { SendableEmbed } from 'revolt-api'; import { SendableEmbed } from 'revolt-api';
import { Low, JSONFile } from 'lowdb'; import { Low, JSONFile } from 'lowdb';
import { decodeTime } from 'ulid'; import { decodeTime } from 'ulid';
import sherlock from "./sherlock"; import sherlock from "./sherlock.js";
import axios from "axios";
config(); config();
@ -255,7 +256,26 @@ client.on('message', async (message) => {
try { try {
if (!message.content || typeof message.content != 'string') return; if (!message.content || typeof message.content != 'string') return;
let args: string[] = Array.from(message.content.match(RE_COMMAND_ARGS) ?? []); let args: string[] = Array.from(message.content.match(RE_COMMAND_ARGS) ?? []);
if (args.shift()?.toLowerCase() != PREFIX_WORD) return; if (args.shift()?.toLowerCase() != PREFIX_WORD) {
if (new RegExp(`<@${client.user?._id}>`).test(message.content.replace(/\s+/, ' '))) {
try {
const blushes = [
':01H2YFQEFWVA2NNAEE6QK1FVBV:', ':01H2YF8BYYAN67MB93QSGQ56ZZ:',
':01H2VPRR4RTP8925T4C0EAYRB2:', ':01H32PAGN69F1F4F91WYRAK63Z:',
':01GJWQXA0K1T8FJVSSSSDVXCN5:', ':01G7YFRJ2T902GFNND6BRNRPMZ:',
];
const blush = blushes[Math.floor(Math.random() * blushes.length)];
const res = await axios.get('https://nekos.best/api/v2/blush');
const url = res.data?.results?.[0]?.url;
if (!url) throw new Error();
await message.reply(`# ${blush}\n[](${url})`);
} catch(e) {
await message.reply('nuh uh');
}
}
return;
}
// Remove quotes // Remove quotes
args = args.map(arg => arg.match(RE_COMMAND_ARG_QUOTED) ? arg.substring(1, arg.length - 1) : arg); args = args.map(arg => arg.match(RE_COMMAND_ARG_QUOTED) ? arg.substring(1, arg.length - 1) : arg);

View file

@ -1,6 +1,6 @@
import { Message } from "revolt.js"; import { Message } from "revolt.js";
import { spawn } from 'child_process'; import { spawn } from 'child_process';
import { embed } from "."; import { embed } from "./index.js";
import { SendableEmbed } from "revolt-api"; import { SendableEmbed } from "revolt-api";
import FormData from 'form-data'; import FormData from 'form-data';
import axios from "axios"; import axios from "axios";