Skip to content

Commit

Permalink
404
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenga8533 committed Jun 9, 2024
1 parent c86b3ed commit 397e65f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 22 deletions.
57 changes: 35 additions & 22 deletions features/party/PartyCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from "../../../axios";
import party from "../../utils/Party";
import Settings from "../../utils/Settings";
import Toggles from "../../utils/Toggles";
import { AQUA, DARK_AQUA, DARK_GRAY, LOGO, RED, WHITE, YELLOW } from "../../utils/Constants";
import { AQUA, DARK_AQUA, DARK_GRAY, DARK_RED, LOGO, RED, WHITE, YELLOW } from "../../utils/Constants";
import { getGuildName, getPlayerName } from "../../utils/functions/player";
import { registerWhen } from "../../utils/RegisterTils";
import { delay } from "../../utils/ThreadTils";
Expand All @@ -20,6 +20,20 @@ const QUOTES = JSON.parse(FileLib.read("VolcAddons", "json/quotes.json"));
const W = ["waifu", "neko", "shinobu", "megumin", "bully", "cuddle", "cry", "hug", "awoo", "kiss", "lick", "pat", "smug", "bonk", "yeet",
"blush", "smile", "wave", "highfive", "handhold", "nom", "bite", "glomp", "slap", "kill", "kick", "happy", "wink", "poke", "dance", "cringe"];

register("command", (send, id, randID, command) => {
if (send !== "false") ChatLib.command(`${send} va-${id}-${command === "nsfw" ? "nw" : "w"} ${randID}`);
else {
const link = `https://i.waifu.pics/${id.replace('@', '.')}`;
new Message(
new TextComponent(LOGO + link).setHoverValue(link),
new TextComponent(` ${DARK_GRAY}[BOOP]`)
.setClickAction("run_command")
.setClickValue(`/va w ${command}`)
.setHoverValue(`${YELLOW}Click to regenerate image.`)
).chat();
}
}).setName("sendWaifu")

/**
* Various party and leader commands.
*
Expand Down Expand Up @@ -110,19 +124,20 @@ export function executeCommand(name, args, sendTo) {

const arg = W.includes(args[1]) ? args[1] :
category === 1 ? W[Math.floor(Math.random() * (W.length - 1))] : W[category - 2];
axios.get(`https://api.waifu.pics/sfw/${arg}`).then(w => {
const nsfw = args[1] === "nsfw";
const link = nsfw ? `https://api.waifu.pics/nsfw/waifu` : `https://api.waifu.pics/sfw/${arg}`;
if (nsfw && !Toggles.r18) return;

axios.get(link).then(w => {
const waifu = w.data.url.split('/')[3].replace('.', '@');
if (sendTo !== false) ChatLib.command(`${sendTo} va-${waifu}-w ${randID}`);
else {
const link = `https://i.waifu.pics/${waifu.replace('@', '.')}`;
new Message(
new TextComponent(LOGO + link).setHoverValue(link),
new TextComponent(` ${DARK_GRAY}[BOOP]`)
.setClickAction("run_command")
.setClickValue(`/va w ${args[1]}`)
.setHoverValue(`${YELLOW}Click to regenerate image.`)
).chat();
}

if (nsfw) {
new TextComponent(`${LOGO + RED}Click to send NSFW image.`)
.setClickAction("run_command")
.setClickValue(`/sendWaifu ${sendTo} ${waifu} ${randID} ${args[1]}`)
.setHoverValue(`${DARK_RED}WARNING: NSFW content!\nContinue at your own risk.`)
.chat();
} else ChatLib.command(`sendWaifu ${sendTo} ${waifu} ${randID} ${args[1]}`, true);
});
break;
case "coords":
Expand Down Expand Up @@ -167,15 +182,6 @@ export function executeCommand(name, args, sendTo) {
if (party.getLeader() && Settings.leaderCommands)
delay(() => ChatLib.command(`${sendTo} Leader Commands: ?<warp, transfer, promote, demote, allinv, stream> ${randID}`), 690);
break;
default:
// Check for unique ?w commands
const wIndex = W.indexOf(command)
if (Toggles.womenCommand === 0 || wIndex === -1) return;

if (sendTo !== false) ChatLib.command(`${sendTo} ${imgur} ${randID}-vaw`);
// Randomize end to avoid duplicate message ^
sendWaifu(wIndex + 2);
break;
} }, 690);

// LEADER COMMANDS
Expand Down Expand Up @@ -347,3 +353,10 @@ register("chat", (player, _, id, __, event) => {
const link = `https://i.waifu.pics/${id.replace('@', '.')}`;
new TextComponent(`&${player}&f: ${link}`).setHoverValue(link).chat();
}).setCriteria("&${player}:${space}va-${id}-w${end}");

register("chat", (player, _, id, __, event) => {
cancel(event);
if (!Toggles.r18) return;
const link = `https://i.waifu.pics/${id.replace('@', '.')}`;
new TextComponent(`&${player}&f: ${link}`).setHoverValue(link).chat();
}).setCriteria("&${player}:${space}va-${id}-nw${end}");
8 changes: 8 additions & 0 deletions utils/toggles.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,14 @@ class Settings {
subcategory: "Party Commands",
})
wScale = 1;
@CheckboxProperty({
name: "R18",
description: "Controls if NSFW content is rendered.",
category: "Party Commands",
subcategory: "Party Commands",
hidden: !FileLib.read("./VolcAddons/Data", "contract.txt")?.split("\n")?.[51]?.includes(Player.getName()) ?? false
})
r18 = false;

// --- KUUDRA ALERTS ---

Expand Down

0 comments on commit 397e65f

Please sign in to comment.