This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Int-CI-Moderation-ModPing: Initial code
- Loading branch information
1 parent
2fb4043
commit 9a37015
Showing
6 changed files
with
239 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { SlashCommandBuilder } from "discord.js"; | ||
import { GuildFeatures } from "@prisma/client"; | ||
import type { MeteoriumChatCommand } from "../../index.js"; | ||
|
||
export const Command: MeteoriumChatCommand = { | ||
interactionData: new SlashCommandBuilder() | ||
.setName("modping") | ||
.setDescription("Initiates a mod ping to call available moderators") | ||
.setDMPermission(false), | ||
requiredFeature: GuildFeatures.Moderation, | ||
async callback(interaction, client) { | ||
return await client.dbUtils.processModPing(interaction.guildId, interaction.user.id, interaction); | ||
}, | ||
initialize(client) { | ||
setInterval(async () => { | ||
client.dbUtils.modPingData.forEach(async (_, i) => { | ||
const [reqId, guildId] = i.split("-"); | ||
await client.dbUtils.processModPing(guildId, reqId); | ||
}); | ||
}, 120000); | ||
}, | ||
}; |