Skip to content

Commit eb22c6e

Browse files
committed
Merge branch 'master' of github.com:mrepol742/project-canis
2 parents a59ed2a + 4cac8a7 commit eb22c6e

49 files changed

Lines changed: 435 additions & 335 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/commands/ai.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,21 @@ export default async function (msg: Message): Promise<void> {
3838
Available Commands:
3939
`;
4040

41-
const excludeAiCommands: string[] = ["mj", "obi", "naij", "chad", "sim"];
41+
const excludeCommands: string[] = [
42+
".",
43+
"ai",
44+
"mj",
45+
"obi",
46+
"naij",
47+
"chad",
48+
"sim",
49+
];
4250

4351
for (const key in commands) {
4452
const cmd = commands[key];
4553
if (
4654
cmd.role === "user" &&
47-
!excludeAiCommands.includes(cmd.command) &&
55+
!excludeCommands.includes(cmd.command) &&
4856
!(cmd.optOutAI ?? false)
4957
) {
5058
prompt += `\n${cmd.command} - ${cmd.description}\n${cmd.usage}\n`;

src/commands/block.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import { Message } from "../types/message"
2-
import log from "../components/utils/log";
3-
import { exec } from "child_process";
4-
import util from "util";
5-
import prisma from "../components/prisma";
6-
import redis from "../components/redis";
7-
import { addBlockUser } from "../components/services/user";
1+
import { Message } from "../types/message";
2+
import { addBlockUser, deductUserPoints } from "../components/services/user";
83

94
export const info = {
105
command: "block",
@@ -24,7 +19,7 @@ export default async function (msg: Message): Promise<void> {
2419
for (const userId of msg.mentionedIds) {
2520
const lid = userId.split("@")[0];
2621

27-
await addBlockUser(lid);
22+
await Promise.allSettled([addBlockUser(lid), deductUserPoints(lid, 30)]);
2823
}
2924

3025
await msg.react("✅");

src/commands/callreject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import log from "../components/utils/log";
55
export const info = {
66
command: "callreject",
77
description: "Automatically declined call.",
8-
usage: "callreject <--on|--off>",
8+
usage: "callreject [--on|--off]",
99
example: "callreject --on",
1010
role: "admin",
1111
cooldown: 5000,

src/commands/echodelete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import log from "../components/utils/log";
55
export const info = {
66
command: "echodelete",
77
description: "Echo deleted messages.",
8-
usage: "echodelete <--on|--off>",
8+
usage: "echodelete [--on|--off]",
99
example: "echodelete --on",
1010
role: "admin",
1111
cooldown: 5000,

src/commands/echoedit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import log from "../components/utils/log";
55
export const info = {
66
command: "echoedit",
77
description: "Echo edit messages.",
8-
usage: "echoedit <--on|--off>",
8+
usage: "echoedit [--on|--off]",
99
example: "echoedit --on",
1010
role: "admin",
1111
cooldown: 5000,

src/commands/fbdl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import he from "he";
99

1010
export const info = {
1111
command: "fbdl",
12-
description: "Download Facebook videos.",
13-
usage: "fbdl <facebook_url>",
12+
description: "Download facebook video from the provided url.",
13+
usage: "fbdl <url>",
1414
example: "fbdl https://www.facebook.com/watch?v=1234567890",
1515
role: "user",
1616
cooldown: 5000,

src/commands/fork.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Message } from "../types/message"
1+
import { Message } from "../types/message";
22

33
export const info = {
44
command: "fork",
5-
description: "Fork this bot on GitHub.",
5+
description: "Display the bot github repository.",
66
usage: "fork",
77
example: "fork",
88
role: "user",

src/commands/googleit.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export default async function (msg: Message): Promise<void> {
4343
}),
4444
page.setViewport({ width: 1366, height: 768 }),
4545
]);
46-
await page.goto(query, { waitUntil: "domcontentloaded", timeout: 15000 });
46+
await page.goto(`https://google.com/search?=${query}`, {
47+
waitUntil: "domcontentloaded",
48+
timeout: 15000,
49+
});
4750

4851
const buffer = await page.screenshot();
4952

src/commands/help.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Message } from "../types/message"
1+
import { Message } from "../types/message";
22
import log from "../components/utils/log";
33
import { commands } from "../components/utils/cmd/loader";
44

55
export const info = {
66
command: "help",
77
description: "List available commands and their usage.",
8-
usage: "help [page] | --[role] | [command]",
9-
example: "help --admin",
8+
usage: "help [page|role|command]",
9+
example: "help admin",
1010
role: "user",
1111
cooldown: 5000,
1212
};
@@ -77,7 +77,7 @@ export default async function (msg: Message): Promise<void> {
7777
}
7878

7979
// help admin
80-
if (/^--admin$/i.test(query)) {
80+
if (/^admin$/i.test(query)) {
8181
const adminCommands = Object.values(commands)
8282
.filter((cmd: CommandType) => cmd.role === "admin")
8383
.map((cmd: CommandType) => cmd.command)
@@ -103,10 +103,10 @@ export default async function (msg: Message): Promise<void> {
103103
.map((cmd: CommandType) => cmd.command)
104104
.sort((a, b) => a.localeCompare(b));
105105

106-
userCommands.unshift("--admin");
107-
userCommands.unshift("--super-admin");
106+
userCommands.unshift("admin");
107+
userCommands.unshift("super-admin");
108108

109-
if (userCommands.length == 0) {
109+
if (Object.values(commands).length === 0) {
110110
await msg.reply(`The *${page}* is obviously is not our bot bounds.`);
111111
return;
112112
}

src/commands/hwaifu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const execPromise = util.promisify(exec);
2020
export const info = {
2121
command: "hwaifu",
2222
description: "Generate a waifu image with optional categories.",
23-
usage: "hwaifu [type]",
23+
usage: "hwaifu [neko|trap|blowjob]",
2424
example: "hwaifu neko",
2525
role: "admin",
2626
cooldown: 5000,

0 commit comments

Comments
 (0)