Refactor API integration by moving rule34 and yandere APIs to plugins and updating message handling

This commit is contained in:
fzzinchemical
2025-03-26 17:33:25 +01:00
parent b4cc5f7a08
commit 58c7932481
3 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import { Bot, Message } from "npm:discordeno@18.0.1";
import { dropdeineMutti, r34test, refresh } from "./r34api.ts";
import { drop5, r34test, refresh } from "./plugins/rule34/api.ts";
import { logMessage } from "./logging.ts";
import { dropYandere, dropYandere5, getPage, setPage } from "./yandereapi.ts";
import { dropYandere, dropYandere5, getPage, setPage } from "./plugins/yandere/api.ts";
const prefix = Deno.env.get("BOT_PREFIX") ?? "";
if (!prefix) {
@@ -31,7 +31,7 @@ export async function messagehandler(bot: Bot, message: Message) {
message.guildId === undefined
) {
bot.helpers.sendMessage(message.channelId, {
content: defaultString(await dropdeineMutti()),
content: defaultString(await drop5()),
});
}
break;

View File

@@ -75,7 +75,7 @@ export async function r34test() {
return hyperlinkarray.pop()!;
}
export async function dropdeineMutti() {
export async function drop5() {
let tmp = "";
for (let i = 0; i < 5; i++) {
tmp += await r34test() + "\n";