Skip to content

Commit e580c49

Browse files
committed
feat: impl paused to paused the bot temp
1 parent 4bd0fe1 commit e580c49

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/commands/paused.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default async function (msg: Message): Promise<void> {
2525
const value = enable ? "on" : "off";
2626

2727
try {
28-
await saveSetting("resent_edit", value);
28+
await saveSetting("paused", value);
2929
await msg.reply(`Paused has been successfully set to \`${value}\`.`);
3030
} catch (err) {
3131
await msg.reply("Failed to update Paused setting. Please try again.");

src/components/events/message.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default async function (msg: Message, type: string): Promise<void> {
5757
* Block users from running commands.
5858
* will always return false if its admin
5959
*/
60-
const [rateLimitResult, isBlockedUser] = await Promise.all([
60+
const [rateLimitResult, isBlockedUser, isPaused] = await Promise.all([
6161
(async () => {
6262
if (msg.fromMe) {
6363
return {
@@ -77,9 +77,10 @@ export default async function (msg: Message, type: string): Promise<void> {
7777
// If the Redis key exists (non-null), return true
7878
return isBlocked;
7979
})(),
80+
getSetting("paused"),
8081
]);
8182

82-
if (isBlockedUser) return;
83+
if (isBlockedUser || (isPaused && isPaused === "on" && !msg.fromMe)) return;
8384

8485
// process normalization
8586
msg.body = msg.body

0 commit comments

Comments
 (0)