Skip to content

Commit 1a29876

Browse files
Techbot121Meta Construct
authored andcommitted
keep depth at default (4)
1 parent 0301608 commit 1a29876

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

app/services/discord/modules/shitposting.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AxiosResponse } from "axios";
22
import { DiscordBot } from "..";
3-
import { IGenerateOptions, Markov } from "../../Markov";
3+
import { Markov } from "../../Markov";
44
import { TenorResponse } from "../../Tenor";
55
import { makeSpeechBubble } from "@/utils";
66
import Discord from "discord.js";
@@ -61,10 +61,6 @@ function getWord(msg?: string) {
6161
return search;
6262
}
6363

64-
const DefaultMarkovConfig: IGenerateOptions = {
65-
depth: ((Math.random() * 2) | 0) + 3, // random number from 3 to 4
66-
};
67-
6864
export const Shat = async (options?: {
6965
msg?: string;
7066
fallback?: string;
@@ -90,20 +86,17 @@ export const Shat = async (options?: {
9086
search = getWord(message);
9187
}
9288

93-
let shat = await markov?.generate(
94-
getWord(search ?? options?.fallback),
95-
DefaultMarkovConfig
96-
);
89+
let shat = await markov?.generate(getWord(search ?? options?.fallback));
9790

98-
if (!shat) shat = await markov?.generate(undefined, DefaultMarkovConfig);
91+
if (!shat) shat = await markov?.generate();
9992

10093
return shat ? { content: shat } : undefined;
10194
} else {
10295
const images = (await globalThis.MetaConcord.container.getService("Motd")).images;
10396
let word =
10497
options?.msg && !options.msg.startsWith("http") ? getWord(options.msg) : undefined;
10598

106-
if (!word) word = getWord(await markov?.generate(undefined, DefaultMarkovConfig));
99+
if (!word) word = getWord(await markov?.generate());
107100

108101
if (images.length !== 0 && (Math.random() <= 0.5 || !word)) {
109102
const imgur = images[(Math.random() * images.length) | 0];
@@ -117,7 +110,7 @@ export const Shat = async (options?: {
117110
).search(word ?? "random", 4);
118111
if (!res || res.data.results.length === 0)
119112
return {
120-
content: await markov?.generate(undefined, DefaultMarkovConfig),
113+
content: await markov?.generate(),
121114
}; // if for some reason we get no result;
122115
return {
123116
content:
@@ -267,7 +260,6 @@ export default async (bot: DiscordBot) => {
267260
const sentence = await (
268261
await bot.container.getService("Markov")
269262
).generate(prefix, {
270-
...DefaultMarkovConfig,
271263
continuation: false,
272264
});
273265

@@ -374,7 +366,7 @@ export default async (bot: DiscordBot) => {
374366
) {
375367
const mk = await (
376368
await bot.container.getService("Markov")
377-
).generate(reaction.emoji.toString(), DefaultMarkovConfig);
369+
).generate(reaction.emoji.toString());
378370
if (mk) {
379371
lastReactedMessages.add(message.id);
380372
await (message.channel as Discord.TextChannel)

0 commit comments

Comments
 (0)