Refactor API integration by moving rule34 and yandere APIs to plugins and updating message handling
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
Reference in New Issue
Block a user