mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-12 06:06:21 +00:00
Compare commits
20 Commits
@revanced/
...
@revanced/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72d6b21384 | ||
|
|
04ce8252c0 | ||
|
|
27e06db1d9 | ||
|
|
3908854fe0 | ||
|
|
0c1382c558 | ||
|
|
410d289297 | ||
|
|
31e5cf7fc5 | ||
|
|
4e797a2cfd | ||
|
|
cb4dc42dfa | ||
|
|
33ba5b1f61 | ||
|
|
247a00f57f | ||
|
|
0da3c989cd | ||
|
|
16d97f409c | ||
|
|
539025f2d4 | ||
|
|
9d705e580c | ||
|
|
aa7501c309 | ||
|
|
00118b4a1b | ||
|
|
65288ec424 | ||
|
|
a5067889b2 | ||
|
|
8efa9091a4 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: '**/node_modules'
|
path: '**/node_modules'
|
||||||
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
|
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
||||||
restore-keys: ${{ runner.os }}-bun-
|
restore-keys: ${{ runner.os }}-bun-
|
||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
Continuing the legacy of Vanced
|
Continuing the legacy of Vanced
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# 🤖 ReVanced Helper
|
# 🤖 ReVanced Bots
|
||||||
|
|
||||||
Bots assisting ReVanced on multiple platforms.
|
Bots assisting ReVanced on multiple platforms.
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,50 @@
|
|||||||
|
# @revanced/discord-bot [1.2.0-dev.1](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.1.2...@revanced/discord-bot@1.2.0-dev.1) (2025-05-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **bots/discord:** switch duration parser to `@sapphire/duration` ([04ce825](https://github.com/revanced/revanced-bots/commit/04ce8252c05a23dbb4a91fded4f1a3d63b5c8a64))
|
||||||
|
|
||||||
|
## @revanced/discord-bot [1.1.2](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.1.1...@revanced/discord-bot@1.1.2) (2025-04-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bots/discord/commands/admin/reload:** fix type error ([3908854](https://github.com/revanced/revanced-bots/commit/3908854fe090dda67b0d90225ab76f75e95db4c0))
|
||||||
|
* **bots/discord/commands/moderation:** check if timeout amount is safe in role-preset commands ([0c1382c](https://github.com/revanced/revanced-bots/commit/0c1382c55856ed1e54c9e53dbb37e9297c5da37c))
|
||||||
|
* **bots/discord:** replace use of deprecated `options.ephemeral` in replies ([31e5cf7](https://github.com/revanced/revanced-bots/commit/31e5cf7fc5c7cd0c6ca3b1f3b9410a88b95d8273))
|
||||||
|
|
||||||
|
## @revanced/discord-bot [1.1.1](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.1.0...@revanced/discord-bot@1.1.1) (2025-04-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bots/discord:** fix sticky msg force timer always starting, add more logging ([cb4dc42](https://github.com/revanced/revanced-bots/commit/cb4dc42dfab8cf9821b03316cf56b405abd497ae))
|
||||||
|
|
||||||
|
# @revanced/discord-bot [1.1.0](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.0.4...@revanced/discord-bot@1.1.0) (2025-04-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **bots/discord:** delete and send sticky msg concurrently, add more logging ([247a00f](https://github.com/revanced/revanced-bots/commit/247a00f57fc2a45fe828cc41e6f0e38e67e83a20))
|
||||||
|
|
||||||
|
## @revanced/discord-bot [1.0.4](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.0.3...@revanced/discord-bot@1.0.4) (2025-04-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bots/discord:** fix sticky messages logic again ([aa7501c](https://github.com/revanced/revanced-bots/commit/aa7501c3097a790265e4ea624d07c4a9c3c1b908))
|
||||||
|
* **bots/discord:** remove expired presets from db if unapplying is not possible ([9d705e5](https://github.com/revanced/revanced-bots/commit/9d705e580c05d8b25df6f845d3aac747adaca116))
|
||||||
|
|
||||||
|
## @revanced/discord-bot [1.0.3](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.0.2...@revanced/discord-bot@1.0.3) (2025-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bots/discord:** attempt to fix sticky messages one last time ([65288ec](https://github.com/revanced/revanced-bots/commit/65288ec4242b32d0b5e213b3d7af602bb9a829ca))
|
||||||
|
|
||||||
|
## @revanced/discord-bot [1.0.2](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.0.1...@revanced/discord-bot@1.0.2) (2025-04-09)
|
||||||
|
|
||||||
## @revanced/discord-bot [1.0.1](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.0.0...@revanced/discord-bot@1.0.1) (2025-04-09)
|
## @revanced/discord-bot [1.0.1](https://github.com/revanced/revanced-bots/compare/@revanced/discord-bot@1.0.0...@revanced/discord-bot@1.0.1) (2025-04-09)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "@revanced/discord-bot",
|
"name": "@revanced/discord-bot",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.1",
|
"version": "1.2.0-dev.1",
|
||||||
"description": "🤖 Discord bot assisting ReVanced",
|
"description": "🤖 Discord bot assisting ReVanced",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -32,11 +32,11 @@
|
|||||||
"@discordjs/rest": "^2.4.3",
|
"@discordjs/rest": "^2.4.3",
|
||||||
"@revanced/bot-api": "workspace:*",
|
"@revanced/bot-api": "workspace:*",
|
||||||
"@revanced/bot-shared": "workspace:*",
|
"@revanced/bot-shared": "workspace:*",
|
||||||
|
"@sapphire/duration": "^1.2.0",
|
||||||
"chalk": "^5.4.1",
|
"chalk": "^5.4.1",
|
||||||
"decancer": "^3.2.8",
|
"decancer": "^3.2.8",
|
||||||
"discord.js": "^14.18.0",
|
"discord.js": "^14.18.0",
|
||||||
"drizzle-orm": "^0.31.4",
|
"drizzle-orm": "^0.31.4"
|
||||||
"parse-duration": "^1.1.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@libsql/client": "^0.7.0",
|
"@libsql/client": "^0.7.0",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { unlinkSync, writeFileSync } from 'fs'
|
|||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { inspect } from 'util'
|
import { inspect } from 'util'
|
||||||
import { createContext, runInContext } from 'vm'
|
import { createContext, runInContext } from 'vm'
|
||||||
import { ApplicationCommandOptionType } from 'discord.js'
|
import { ApplicationCommandOptionType, MessageFlags } from 'discord.js'
|
||||||
|
|
||||||
import { AdminCommand } from '$/classes/Command'
|
import { AdminCommand } from '$/classes/Command'
|
||||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||||
@@ -85,8 +85,8 @@ export default new AdminCommand({
|
|||||||
})
|
})
|
||||||
|
|
||||||
await trigger.reply({
|
await trigger.reply({
|
||||||
ephemeral: true,
|
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
|
flags: MessageFlags.Ephemeral,
|
||||||
files,
|
files,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { AdminCommand } from '$/classes/Command'
|
import { AdminCommand } from '$/classes/Command'
|
||||||
|
import { type CommandInteraction, MessageFlags } from 'discord.js'
|
||||||
|
|
||||||
export default new AdminCommand({
|
export default new AdminCommand({
|
||||||
name: 'reload',
|
name: 'reload',
|
||||||
@@ -10,7 +11,8 @@ export default new AdminCommand({
|
|||||||
logger.debug('Invalidating previous config...')
|
logger.debug('Invalidating previous config...')
|
||||||
context.config.invalidate()
|
context.config.invalidate()
|
||||||
|
|
||||||
if ('deferReply' in trigger) await trigger.deferReply({ ephemeral: true })
|
if ((trigger as CommandInteraction).deferReply)
|
||||||
|
await (trigger as CommandInteraction).deferReply({ flags: MessageFlags.Ephemeral })
|
||||||
|
|
||||||
logger.info('Reinitializing API client to reload configuration...')
|
logger.info('Reinitializing API client to reload configuration...')
|
||||||
await api.client.ws.setOptions(
|
await api.client.ws.setOptions(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { AdminCommand } from '$/classes/Command'
|
import { AdminCommand } from '$/classes/Command'
|
||||||
|
import { MessageFlags } from 'discord.js'
|
||||||
|
|
||||||
export default new AdminCommand({
|
export default new AdminCommand({
|
||||||
name: 'stop',
|
name: 'stop',
|
||||||
@@ -9,7 +10,7 @@ export default new AdminCommand({
|
|||||||
logger.fatal('Stopping bot...')
|
logger.fatal('Stopping bot...')
|
||||||
trigger.reply({
|
trigger.reply({
|
||||||
content: 'Stopping... (I will go offline once done)',
|
content: 'Stopping... (I will go offline once done)',
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!api.client.disconnected) api.client.disconnect()
|
if (!api.client.disconnected) api.client.disconnect()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { EmbedBuilder } from 'discord.js'
|
import { EmbedBuilder, MessageFlags } from 'discord.js'
|
||||||
|
|
||||||
import Command from '$/classes/Command'
|
import Command from '$/classes/Command'
|
||||||
import { applyCommonEmbedStyles } from '$/utils/discord/embeds'
|
import { applyCommonEmbedStyles } from '$/utils/discord/embeds'
|
||||||
@@ -18,6 +18,7 @@ export default new Command({
|
|||||||
const reply = await trigger
|
const reply = await trigger
|
||||||
.reply({
|
.reply({
|
||||||
embeds: [embed.toJSON()],
|
embeds: [embed.toJSON()],
|
||||||
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
.then(it => it.fetch())
|
.then(it => it.fetch())
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||||
import { ApplicationCommandOptionType, Message } from 'discord.js'
|
import { ApplicationCommandOptionType, Message, MessageFlags } from 'discord.js'
|
||||||
import { ModerationCommand } from '../../classes/Command'
|
import { ModerationCommand } from '../../classes/Command'
|
||||||
|
|
||||||
export default new ModerationCommand({
|
export default new ModerationCommand({
|
||||||
@@ -40,7 +40,7 @@ export default new ModerationCommand({
|
|||||||
|
|
||||||
await trigger.reply({
|
await trigger.reply({
|
||||||
content: 'OK!',
|
content: 'OK!',
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { ModerationCommand } from '$/classes/Command'
|
import { ModerationCommand } from '$/classes/Command'
|
||||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||||
import { cureNickname } from '$/utils/discord/moderation'
|
import { cureNickname } from '$/utils/discord/moderation'
|
||||||
|
import { MessageFlags } from 'discord.js'
|
||||||
|
|
||||||
export default new ModerationCommand({
|
export default new ModerationCommand({
|
||||||
name: 'cure',
|
name: 'cure',
|
||||||
@@ -18,7 +19,7 @@ export default new ModerationCommand({
|
|||||||
await cureNickname(member)
|
await cureNickname(member)
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [createSuccessEmbed(null, `Cured nickname for ${member.toString()}`)],
|
embeds: [createSuccessEmbed(null, `Cured nickname for ${member.toString()}`)],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default new ModerationCommand({
|
|||||||
createModerationActionEmbed('Muted', user, executor.user, reason, Math.ceil(expires / 1000)),
|
createModerationActionEmbed('Muted', user, executor.user, reason, Math.ceil(expires / 1000)),
|
||||||
)
|
)
|
||||||
|
|
||||||
if (duration)
|
if (Number.isSafeInteger(expires))
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
removeRolePreset(member, 'mute')
|
removeRolePreset(member, 'mute')
|
||||||
}, duration)
|
}, duration)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default new ModerationCommand({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expires)
|
if (Number.isSafeInteger(expires))
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
removeRolePreset(member, preset)
|
removeRolePreset(member, preset)
|
||||||
}, expires)
|
}, expires)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Command from '$/classes/Command'
|
|||||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||||
import type { ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
import type { ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
||||||
import type { FetchMessageOptions, MessageResolvable } from 'discord.js'
|
import { type FetchMessageOptions, MessageFlags, type MessageResolvable } from 'discord.js'
|
||||||
import { config } from '../../../context'
|
import { config } from '../../../context'
|
||||||
|
|
||||||
const msRcConfig = config.messageScan?.humanCorrections?.allow
|
const msRcConfig = config.messageScan?.humanCorrections?.allow
|
||||||
@@ -70,7 +70,7 @@ export default new Command({
|
|||||||
`The provided message has been trained as \`${label}\`. Thank you for your contribution!`,
|
`The provided message has been trained as \`${label}\`. Thank you for your contribution!`,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Command from '$/classes/Command'
|
import Command from '$/classes/Command'
|
||||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||||
import type { ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
import type { ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
||||||
import { type APIStringSelectComponent, ComponentType } from 'discord.js'
|
import { type APIStringSelectComponent, ComponentType, MessageFlags } from 'discord.js'
|
||||||
import { config } from '../../../context'
|
import { config } from '../../../context'
|
||||||
|
|
||||||
const msRcConfig = config.messageScan?.humanCorrections?.allow
|
const msRcConfig = config.messageScan?.humanCorrections?.allow
|
||||||
@@ -44,7 +44,7 @@ export default new Command({
|
|||||||
type: ComponentType.ActionRow,
|
type: ComponentType.ActionRow,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export const discord = {
|
|||||||
timerActive: boolean
|
timerActive: boolean
|
||||||
timerMs: number
|
timerMs: number
|
||||||
forceTimerMs?: number
|
forceTimerMs?: number
|
||||||
send: (forced?: boolean) => Promise<void>
|
send: () => Promise<void>
|
||||||
currentMessage?: Message<true>
|
currentMessage?: Message<true>
|
||||||
timer?: NodeJS.Timeout
|
timer?: NodeJS.Timeout
|
||||||
forceTimer?: NodeJS.Timeout
|
forceTimer?: NodeJS.Timeout
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import CommandError from '$/classes/CommandError'
|
import CommandError from '$/classes/CommandError'
|
||||||
import { createStackTraceEmbed } from '$utils/discord/embeds'
|
import { createStackTraceEmbed } from '$utils/discord/embeds'
|
||||||
import { on, withContext } from '$utils/discord/events'
|
import { on, withContext } from '$utils/discord/events'
|
||||||
|
import { MessageFlags } from 'discord.js'
|
||||||
|
|
||||||
withContext(on, 'interactionCreate', async (context, interaction) => {
|
withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
@@ -20,7 +21,7 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
|||||||
|
|
||||||
await interaction[interaction.replied ? 'followUp' : 'reply']({
|
await interaction[interaction.replied ? 'followUp' : 'reply']({
|
||||||
embeds: [err instanceof CommandError ? err.toEmbed() : createStackTraceEmbed(err)],
|
embeds: [err instanceof CommandError ? err.toEmbed() : createStackTraceEmbed(err)],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 100 and up are user errors
|
// 100 and up are user errors
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import CommandError from '$/classes/CommandError'
|
import CommandError from '$/classes/CommandError'
|
||||||
import { createStackTraceEmbed } from '$utils/discord/embeds'
|
import { createStackTraceEmbed } from '$utils/discord/embeds'
|
||||||
import { on, withContext } from '$utils/discord/events'
|
import { on, withContext } from '$utils/discord/events'
|
||||||
|
import { MessageFlags } from 'discord.js'
|
||||||
|
|
||||||
withContext(on, 'interactionCreate', async (context, interaction) => {
|
withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||||
if (!interaction.isContextMenuCommand()) return
|
if (!interaction.isContextMenuCommand()) return
|
||||||
@@ -20,7 +21,7 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
|||||||
logger.error(`Error while executing command ${interaction.commandName}:`, err)
|
logger.error(`Error while executing command ${interaction.commandName}:`, err)
|
||||||
await interaction[interaction.replied ? 'followUp' : 'reply']({
|
await interaction[interaction.replied ? 'followUp' : 'reply']({
|
||||||
embeds: [err instanceof CommandError ? err.toEmbed() : createStackTraceEmbed(err)],
|
embeds: [err instanceof CommandError ? err.toEmbed() : createStackTraceEmbed(err)],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,12 @@ import { handleUserResponseCorrection } from '$/utils/discord/messageScan'
|
|||||||
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$utils/discord/embeds'
|
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$utils/discord/embeds'
|
||||||
import { on, withContext } from '$utils/discord/events'
|
import { on, withContext } from '$utils/discord/events'
|
||||||
|
|
||||||
import type { ButtonInteraction, StringSelectMenuInteraction, TextBasedChannel } from 'discord.js'
|
import {
|
||||||
|
type ButtonInteraction,
|
||||||
|
MessageFlags,
|
||||||
|
type StringSelectMenuInteraction,
|
||||||
|
type TextBasedChannel,
|
||||||
|
} from 'discord.js'
|
||||||
import { eq } from 'drizzle-orm'
|
import { eq } from 'drizzle-orm'
|
||||||
|
|
||||||
// No permission check required as it is already done when the user reacts to a bot response
|
// No permission check required as it is already done when the user reacts to a bot response
|
||||||
@@ -26,7 +31,7 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
|||||||
if (!response)
|
if (!response)
|
||||||
return void (await interaction.reply({
|
return void (await interaction.reply({
|
||||||
content: "I don't recall having sent this response, so I cannot correct it.",
|
content: "I don't recall having sent this response, so I cannot correct it.",
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -91,7 +96,7 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
|||||||
logger.error('Failed to handle correct response interaction:', e)
|
logger.error('Failed to handle correct response interaction:', e)
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [createStackTraceEmbed(e)],
|
embeds: [createStackTraceEmbed(e)],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$utils/discord/embeds'
|
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$utils/discord/embeds'
|
||||||
import { on, withContext } from '$utils/discord/events'
|
import { on, withContext } from '$utils/discord/events'
|
||||||
|
import { MessageFlags, type TextBasedChannel } from 'discord.js'
|
||||||
import type { TextBasedChannel } from 'discord.js'
|
|
||||||
|
|
||||||
withContext(on, 'interactionCreate', async (context, interaction) => {
|
withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||||
const {
|
const {
|
||||||
@@ -28,7 +27,7 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
|||||||
'Thank you for your contribution! Unfortunately, the message could not be found.',
|
'Thank you for your contribution! Unfortunately, the message could not be found.',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const selectedLabel = interaction.values[0]!
|
const selectedLabel = interaction.values[0]!
|
||||||
@@ -40,13 +39,13 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
|||||||
`Thank you for your contribution! The selected message is being trained as \`${selectedLabel}\`. 🎉`,
|
`Thank you for your contribution! The selected message is being trained as \`${selectedLabel}\`. 🎉`,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error('Failed to handle train message interaction:', e)
|
logger.error('Failed to handle train message interaction:', e)
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [createStackTraceEmbed(e)],
|
embeds: [createStackTraceEmbed(e)],
|
||||||
ephemeral: true,
|
flags: MessageFlags.Ephemeral,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,41 +7,22 @@ withContext(on, 'messageCreate', async ({ discord, logger }, msg) => {
|
|||||||
const store = discord.stickyMessages[msg.guildId]?.[msg.channelId]
|
const store = discord.stickyMessages[msg.guildId]?.[msg.channelId]
|
||||||
if (!store) return
|
if (!store) return
|
||||||
|
|
||||||
if (store.timerActive) {
|
// Timer is already active from previous event, and force timer isn't active, so we start the latter
|
||||||
// Timer is already active, so we try to start the force timer
|
if (store.timerActive && store.forceTimerMs && !store.forceTimerActive) {
|
||||||
if (store.forceTimerMs) {
|
|
||||||
// Force timer isn't active, so we start it
|
|
||||||
if (!store.forceTimerActive) {
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Channel ${msg.channelId} in guild ${msg.guildId} is active, starting force send timer and clearing existing timer`,
|
`Channel ${msg.channelId} in guild ${msg.guildId} is very active, starting sticky message force timer`,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clear the timer
|
|
||||||
clearTimeout(store.timer)
|
|
||||||
store.timerActive = false
|
|
||||||
|
|
||||||
// (Re)start the force timer
|
// (Re)start the force timer
|
||||||
store.forceTimerActive = true
|
store.forceTimerActive = true
|
||||||
if (!store.forceTimer)
|
if (store.forceTimer) store.forceTimer.refresh()
|
||||||
store.forceTimer = setTimeout(
|
else store.forceTimer = setTimeout(store.send, store.forceTimerMs)
|
||||||
() =>
|
|
||||||
store.send(true).then(() => {
|
|
||||||
store.forceTimerActive = false
|
|
||||||
}),
|
|
||||||
store.forceTimerMs,
|
|
||||||
) as NodeJS.Timeout
|
|
||||||
else store.forceTimer.refresh()
|
|
||||||
} else {
|
|
||||||
// Force timer is already active, so we clear the force timer
|
|
||||||
store.forceTimerActive = false
|
|
||||||
clearTimeout(store.forceTimer)
|
|
||||||
// and force send
|
|
||||||
store.send(true)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (!store.forceTimerActive) {
|
logger.debug(`Channel ${msg.channelId} in guild ${msg.guildId} is active, starting sticky message timer`)
|
||||||
// Both timers aren't active, so we start the timer
|
|
||||||
|
// (Re)start the timer
|
||||||
store.timerActive = true
|
store.timerActive = true
|
||||||
if (!store.timer) store.timer = setTimeout(store.send, store.timerMs) as NodeJS.Timeout
|
if (store.timer) store.timer.refresh()
|
||||||
}
|
else store.timer = setTimeout(store.send, store.timerMs) as NodeJS.Timeout
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
import { database, logger } from '$/context'
|
|
||||||
import { appliedPresets } from '$/database/schemas'
|
|
||||||
import { applyCommonEmbedStyles } from '$/utils/discord/embeds'
|
|
||||||
import { on, withContext } from '$/utils/discord/events'
|
|
||||||
import { removeRolePreset } from '$/utils/discord/rolePresets'
|
|
||||||
import { and, eq, lt } from 'drizzle-orm'
|
|
||||||
|
|
||||||
import type { Client } from 'discord.js'
|
|
||||||
|
|
||||||
export default withContext(on, 'ready', async ({ config, discord, logger }, client) => {
|
|
||||||
logger.info(`Connected to Discord API, logged in as ${client.user.displayName} (@${client.user.tag})!`)
|
|
||||||
logger.info(`Bot is in ${client.guilds.cache.size} guilds`)
|
|
||||||
|
|
||||||
if (config.stickyMessages)
|
|
||||||
for (const [guildId, channels] of Object.entries(config.stickyMessages)) {
|
|
||||||
const guild = await client.guilds.fetch(guildId)
|
|
||||||
// In case of configuration refresh, this will not be nullable
|
|
||||||
const oldStore = discord.stickyMessages[guildId]
|
|
||||||
discord.stickyMessages[guildId] = {}
|
|
||||||
|
|
||||||
for (const [channelId, { message, timeout, forceSendTimeout }] of Object.entries(channels)) {
|
|
||||||
const channel = await guild.channels.fetch(channelId)
|
|
||||||
if (!channel?.isTextBased())
|
|
||||||
return void logger.warn(
|
|
||||||
`Channel ${channelId} in guild ${guildId} is not a text channel, sticky messages will not be sent`,
|
|
||||||
)
|
|
||||||
|
|
||||||
const send = async (forced = false) => {
|
|
||||||
try {
|
|
||||||
const msg = await channel.send({
|
|
||||||
...message,
|
|
||||||
embeds: message.embeds?.map(it => applyCommonEmbedStyles(it, true, true, true)),
|
|
||||||
})
|
|
||||||
|
|
||||||
const store = discord.stickyMessages[guildId]![channelId]
|
|
||||||
if (!store) return
|
|
||||||
|
|
||||||
await store.currentMessage?.delete().catch()
|
|
||||||
store.currentMessage = msg
|
|
||||||
|
|
||||||
// Clear any remaining timers
|
|
||||||
clearTimeout(store.timer)
|
|
||||||
clearTimeout(store.forceTimer)
|
|
||||||
store.forceTimerActive = store.timerActive = false
|
|
||||||
|
|
||||||
if (!forced)
|
|
||||||
logger.debug(
|
|
||||||
`Timeout ended for sticky message in channel ${channelId} in guild ${guildId}, channel is inactive`,
|
|
||||||
)
|
|
||||||
else
|
|
||||||
logger.debug(
|
|
||||||
`Forced send timeout for sticky message in channel ${channelId} in guild ${guildId} ended, channel is too active`,
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.debug(`Sent sticky message to channel ${channelId} in guild ${guildId}`)
|
|
||||||
} catch (e) {
|
|
||||||
logger.error(
|
|
||||||
`Error while sending sticky message to channel ${channelId} in guild ${guildId}:`,
|
|
||||||
e,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set up the store
|
|
||||||
discord.stickyMessages[guildId]![channelId] = {
|
|
||||||
forceTimerActive: false,
|
|
||||||
timerActive: false,
|
|
||||||
forceTimerMs: forceSendTimeout,
|
|
||||||
timerMs: timeout,
|
|
||||||
send,
|
|
||||||
// If the store exists before the configuration refresh, take its current message
|
|
||||||
currentMessage: oldStore?.[channelId]?.currentMessage,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send a new sticky message immediately, as well as deleting the old/outdated message, if it exists
|
|
||||||
await send()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.rolePresets) {
|
|
||||||
removeExpiredPresets(client)
|
|
||||||
setTimeout(() => removeExpiredPresets(client), config.rolePresets.checkExpiredEvery)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const removeExpiredPresets = async (client: Client) => {
|
|
||||||
logger.debug('Checking for expired role presets...')
|
|
||||||
|
|
||||||
const expireds = await database.query.appliedPresets.findMany({
|
|
||||||
where: lt(appliedPresets.until, Math.floor(Date.now() / 1000)),
|
|
||||||
})
|
|
||||||
|
|
||||||
for (const expired of expireds)
|
|
||||||
try {
|
|
||||||
logger.debug(`Removing role preset for ${expired.memberId} in ${expired.guildId}`)
|
|
||||||
|
|
||||||
const guild = await client.guilds.fetch(expired.guildId)
|
|
||||||
const member = await guild.members.fetch(expired.memberId)
|
|
||||||
|
|
||||||
await removeRolePreset(member, expired.preset)
|
|
||||||
await database
|
|
||||||
.delete(appliedPresets)
|
|
||||||
.where(and(eq(appliedPresets.guildId, expired.guildId), eq(appliedPresets.memberId, expired.memberId)))
|
|
||||||
} catch (e) {
|
|
||||||
logger.error(`Error while removing role preset for ${expired.memberId} in ${expired.guildId}: ${e}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
6
bots/discord/src/events/discord/ready/log.ts
Normal file
6
bots/discord/src/events/discord/ready/log.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { on, withContext } from '$/utils/discord/events'
|
||||||
|
|
||||||
|
export default withContext(on, 'ready', async ({ logger }, client) => {
|
||||||
|
logger.info(`Connected to Discord API, logged in as ${client.user.displayName} (@${client.user.tag})!`)
|
||||||
|
logger.info(`Bot is in ${client.guilds.cache.size} guilds`)
|
||||||
|
})
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import { database, logger } from '$/context'
|
||||||
|
import { appliedPresets } from '$/database/schemas'
|
||||||
|
import { on, withContext } from '$/utils/discord/events'
|
||||||
|
import { removeRolePreset } from '$/utils/discord/rolePresets'
|
||||||
|
import { and, eq, lt } from 'drizzle-orm'
|
||||||
|
|
||||||
|
import { type Client, DiscordAPIError } from 'discord.js'
|
||||||
|
|
||||||
|
export default withContext(on, 'ready', async ({ config }, client) => {
|
||||||
|
if (config.rolePresets) {
|
||||||
|
removeExpiredPresets(client)
|
||||||
|
setTimeout(() => removeExpiredPresets(client), config.rolePresets.checkExpiredEvery)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
async function removeExpiredPresets(client: Client) {
|
||||||
|
logger.debug('Checking for expired role presets...')
|
||||||
|
|
||||||
|
const expireds = await database.query.appliedPresets.findMany({
|
||||||
|
where: lt(appliedPresets.until, Math.floor(Date.now() / 1000)),
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const expired of expireds) {
|
||||||
|
try {
|
||||||
|
logger.debug(`Removing role preset for ${expired.memberId} in ${expired.guildId}`)
|
||||||
|
|
||||||
|
const guild = await client.guilds.fetch(expired.guildId)
|
||||||
|
const member = await guild.members.fetch(expired.memberId)
|
||||||
|
|
||||||
|
await removeRolePreset(member, expired.preset)
|
||||||
|
} catch (e) {
|
||||||
|
// Unknown Member: https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
|
||||||
|
if (!(e instanceof DiscordAPIError) || e.code !== 10007) {
|
||||||
|
logger.error(`Error while removing role preset for ${expired.memberId} in ${expired.guildId}: ${e}`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await database
|
||||||
|
.delete(appliedPresets)
|
||||||
|
.where(and(eq(appliedPresets.guildId, expired.guildId), eq(appliedPresets.memberId, expired.memberId)))
|
||||||
|
}
|
||||||
|
}
|
||||||
68
bots/discord/src/events/discord/ready/stickyMessageSetup.ts
Normal file
68
bots/discord/src/events/discord/ready/stickyMessageSetup.ts
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
import { applyCommonEmbedStyles } from '$/utils/discord/embeds'
|
||||||
|
import { on, withContext } from '$/utils/discord/events'
|
||||||
|
|
||||||
|
export default withContext(on, 'ready', async ({ config, discord, logger }, client) => {
|
||||||
|
if (config.stickyMessages)
|
||||||
|
for (const [guildId, channels] of Object.entries(config.stickyMessages)) {
|
||||||
|
const guild = await client.guilds.fetch(guildId)
|
||||||
|
// In case of configuration refresh, this will not be nullable
|
||||||
|
const oldStore = discord.stickyMessages[guildId]
|
||||||
|
discord.stickyMessages[guildId] = {}
|
||||||
|
|
||||||
|
for (const [channelId, { message, timeout, forceSendTimeout }] of Object.entries(channels)) {
|
||||||
|
const channel = await guild.channels.fetch(channelId)
|
||||||
|
if (!channel?.isTextBased())
|
||||||
|
return void logger.warn(
|
||||||
|
`Channel ${channelId} in guild ${guildId} is not a text channel, sticky messages will not be sent`,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Set up the store
|
||||||
|
// biome-ignore lint/suspicious/noAssignInExpressions: don't care
|
||||||
|
const store = (discord.stickyMessages[guildId]![channelId] = {
|
||||||
|
forceTimerActive: false,
|
||||||
|
timerActive: false,
|
||||||
|
forceTimerMs: forceSendTimeout,
|
||||||
|
timerMs: timeout,
|
||||||
|
async send() {
|
||||||
|
try {
|
||||||
|
await Promise.all([
|
||||||
|
channel
|
||||||
|
.send({
|
||||||
|
...message,
|
||||||
|
embeds: message.embeds?.map(it => applyCommonEmbedStyles(it, true, true, true)),
|
||||||
|
})
|
||||||
|
.then(msg => {
|
||||||
|
this.currentMessage = msg
|
||||||
|
logger.debug(`Sent sticky message to channel ${channelId} in guild ${guildId}`)
|
||||||
|
}),
|
||||||
|
this.currentMessage
|
||||||
|
?.delete()
|
||||||
|
?.then(() =>
|
||||||
|
logger.debug(
|
||||||
|
`Deleted old sticky message from channel ${channelId} in guild ${guildId}`,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
])
|
||||||
|
} catch (e) {
|
||||||
|
logger.error(
|
||||||
|
`Error while managing sticky message of channel ${channelId} in guild ${guildId}:`,
|
||||||
|
e,
|
||||||
|
)
|
||||||
|
} finally {
|
||||||
|
// Clear any remaining timers
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
clearTimeout(this.forceTimer)
|
||||||
|
this.forceTimerActive = this.timerActive = false
|
||||||
|
|
||||||
|
logger.debug(`Cleared sticky message timer for channel ${channelId} in guild ${guildId}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// If the store exists before the configuration refresh, take its current message
|
||||||
|
currentMessage: oldStore?.[channelId]?.currentMessage,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Send a new sticky message immediately, as well as deleting the old/outdated message, if it exists
|
||||||
|
await store.send()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,25 +1,40 @@
|
|||||||
import parse from 'parse-duration'
|
import { Duration, DurationFormatter } from '@sapphire/duration'
|
||||||
|
|
||||||
parse[''] = parse['s']!
|
const fmt = new DurationFormatter({
|
||||||
parse['mo'] = parse['M'] = parse['month']!
|
year: {
|
||||||
|
DEFAULT: 'y',
|
||||||
|
},
|
||||||
|
month: {
|
||||||
|
DEFAULT: 'M',
|
||||||
|
},
|
||||||
|
week: {
|
||||||
|
DEFAULT: 'w',
|
||||||
|
},
|
||||||
|
day: {
|
||||||
|
DEFAULT: 'd',
|
||||||
|
},
|
||||||
|
hour: {
|
||||||
|
DEFAULT: 'h',
|
||||||
|
},
|
||||||
|
minute: {
|
||||||
|
DEFAULT: 'm',
|
||||||
|
},
|
||||||
|
second: {
|
||||||
|
DEFAULT: 's',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
export const parseDuration = (duration: string, defaultUnit?: parse.Units) => {
|
export const parseDuration = (duration: string, defaultUnit = 's') => {
|
||||||
const defaultUnitValue = parse['']!
|
// adds default unit to the end of the string if it doesn't have a unit
|
||||||
if (defaultUnit) parse[''] = parse[defaultUnit]!
|
// 100 -> 100s
|
||||||
const result = parse(duration, 'ms') ?? Number.NaN
|
// 10m100 -> 10m100s
|
||||||
parse[''] = defaultUnitValue
|
// biome-ignore lint/style/noParameterAssign: this is fine
|
||||||
return result
|
if (/\d$/.test(duration)) duration += defaultUnit
|
||||||
|
return new Duration(duration).offset
|
||||||
}
|
}
|
||||||
|
|
||||||
export const durationToString = (duration: number) => {
|
export const durationToString = (duration: number) => {
|
||||||
if (duration === 0) return '0s'
|
return fmt.format(duration, undefined, {
|
||||||
|
left: '',
|
||||||
const days = Math.floor(duration / (24 * 60 * 60 * 1000))
|
})
|
||||||
const hours = Math.floor((duration % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000))
|
|
||||||
const minutes = Math.floor((duration % (60 * 60 * 1000)) / (60 * 1000))
|
|
||||||
const seconds = Math.floor((duration % (60 * 1000)) / 1000)
|
|
||||||
|
|
||||||
return `${days ? `${days}d` : ''}${hours ? `${hours}h` : ''}${minutes ? `${minutes}m` : ''}${
|
|
||||||
seconds ? `${seconds}s` : ''
|
|
||||||
}`
|
|
||||||
}
|
}
|
||||||
|
|||||||
15
bun.lock
15
bun.lock
@@ -25,7 +25,7 @@
|
|||||||
},
|
},
|
||||||
"apis/websocket": {
|
"apis/websocket": {
|
||||||
"name": "@revanced/bot-websocket-api",
|
"name": "@revanced/bot-websocket-api",
|
||||||
"version": "1.0.0-dev.10",
|
"version": "1.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@revanced/bot-shared": "workspace:*",
|
"@revanced/bot-shared": "workspace:*",
|
||||||
"@sapphire/async-queue": "^1.5.5",
|
"@sapphire/async-queue": "^1.5.5",
|
||||||
@@ -40,17 +40,17 @@
|
|||||||
},
|
},
|
||||||
"bots/discord": {
|
"bots/discord": {
|
||||||
"name": "@revanced/discord-bot",
|
"name": "@revanced/discord-bot",
|
||||||
"version": "1.0.0-dev.36",
|
"version": "1.1.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/builders": "^1.10.1",
|
"@discordjs/builders": "^1.10.1",
|
||||||
"@discordjs/rest": "^2.4.3",
|
"@discordjs/rest": "^2.4.3",
|
||||||
"@revanced/bot-api": "workspace:*",
|
"@revanced/bot-api": "workspace:*",
|
||||||
"@revanced/bot-shared": "workspace:*",
|
"@revanced/bot-shared": "workspace:*",
|
||||||
|
"@sapphire/duration": "^1.2.0",
|
||||||
"chalk": "^5.4.1",
|
"chalk": "^5.4.1",
|
||||||
"decancer": "^3.2.8",
|
"decancer": "^3.2.8",
|
||||||
"discord.js": "^14.18.0",
|
"discord.js": "^14.18.0",
|
||||||
"drizzle-orm": "^0.31.4",
|
"drizzle-orm": "^0.31.4",
|
||||||
"parse-duration": "^1.1.2",
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@libsql/client": "^0.7.0",
|
"@libsql/client": "^0.7.0",
|
||||||
@@ -74,8 +74,8 @@
|
|||||||
"name": "@revanced/bot-shared",
|
"name": "@revanced/bot-shared",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bson": "^6.8.0",
|
"bson": "^6.10.3",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.4.1",
|
||||||
"tracer": "^1.3.0",
|
"tracer": "^1.3.0",
|
||||||
"valibot": "^0.30.0",
|
"valibot": "^0.30.0",
|
||||||
},
|
},
|
||||||
@@ -88,6 +88,7 @@
|
|||||||
"lefthook",
|
"lefthook",
|
||||||
],
|
],
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
|
"discord.js@14.18.0": "patches/discord.js@14.18.0.patch",
|
||||||
"@semantic-release/npm@12.0.1": "patches/@semantic-release%2Fnpm@12.0.1.patch",
|
"@semantic-release/npm@12.0.1": "patches/@semantic-release%2Fnpm@12.0.1.patch",
|
||||||
"drizzle-kit@0.22.8": "patches/drizzle-kit@0.22.8.patch",
|
"drizzle-kit@0.22.8": "patches/drizzle-kit@0.22.8.patch",
|
||||||
},
|
},
|
||||||
@@ -336,6 +337,8 @@
|
|||||||
|
|
||||||
"@sapphire/async-queue": ["@sapphire/async-queue@1.5.5", "", {}, "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg=="],
|
"@sapphire/async-queue": ["@sapphire/async-queue@1.5.5", "", {}, "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg=="],
|
||||||
|
|
||||||
|
"@sapphire/duration": ["@sapphire/duration@1.2.0", "", {}, "sha512-LxjOAFXz81WmrI8XX9YaVcAZDjQj/1p78lZCvkAWZB1nphOwz/D0dU3CBejmhOWx5dO5CszTkLJMNR0xuCK+Zg=="],
|
||||||
|
|
||||||
"@sapphire/shapeshift": ["@sapphire/shapeshift@4.0.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21" } }, "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg=="],
|
"@sapphire/shapeshift": ["@sapphire/shapeshift@4.0.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21" } }, "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg=="],
|
||||||
|
|
||||||
"@sapphire/snowflake": ["@sapphire/snowflake@3.5.3", "", {}, "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ=="],
|
"@sapphire/snowflake": ["@sapphire/snowflake@3.5.3", "", {}, "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ=="],
|
||||||
@@ -980,8 +983,6 @@
|
|||||||
|
|
||||||
"parse-conflict-json": ["parse-conflict-json@3.0.1", "", { "dependencies": { "json-parse-even-better-errors": "^3.0.0", "just-diff": "^6.0.0", "just-diff-apply": "^5.2.0" } }, "sha512-01TvEktc68vwbJOtWZluyWeVGWjP+bZwXtPDMQVbBKzbJ/vZBif0L69KH1+cHv1SZ6e0FKLvjyHe8mqsIqYOmw=="],
|
"parse-conflict-json": ["parse-conflict-json@3.0.1", "", { "dependencies": { "json-parse-even-better-errors": "^3.0.0", "just-diff": "^6.0.0", "just-diff-apply": "^5.2.0" } }, "sha512-01TvEktc68vwbJOtWZluyWeVGWjP+bZwXtPDMQVbBKzbJ/vZBif0L69KH1+cHv1SZ6e0FKLvjyHe8mqsIqYOmw=="],
|
||||||
|
|
||||||
"parse-duration": ["parse-duration@1.1.2", "", {}, "sha512-p8EIONG8L0u7f8GFgfVlL4n8rnChTt8O5FSxgxMz2tjc9FMP199wxVKVB6IbKx11uTbKHACSvaLVIKNnoeNR/A=="],
|
|
||||||
|
|
||||||
"parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="],
|
"parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="],
|
||||||
|
|
||||||
"parse-ms": ["parse-ms@4.0.0", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="],
|
"parse-ms": ["parse-ms@4.0.0", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="],
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"@semantic-release/npm@12.0.1": "patches/@semantic-release%2Fnpm@12.0.1.patch",
|
"@semantic-release/npm@12.0.1": "patches/@semantic-release%2Fnpm@12.0.1.patch",
|
||||||
"drizzle-kit@0.22.8": "patches/drizzle-kit@0.22.8.patch",
|
"drizzle-kit@0.22.8": "patches/drizzle-kit@0.22.8.patch",
|
||||||
"decancer@3.2.4": "patches/decancer@3.2.4.patch"
|
"decancer@3.2.4": "patches/decancer@3.2.4.patch",
|
||||||
|
"discord.js@14.18.0": "patches/discord.js@14.18.0.patch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
17
patches/discord.js@14.18.0.patch
Normal file
17
patches/discord.js@14.18.0.patch
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Make Message#reply work with { flags: MessageFlags.Ephemeral } in typings
|
||||||
|
# So our Command system doesn't break
|
||||||
|
diff --git a/typings/index.d.mts b/typings/index.d.mts
|
||||||
|
index 645b870..fa93158 100644
|
||||||
|
--- a/typings/index.d.mts
|
||||||
|
+++ b/typings/index.d.mts
|
||||||
|
@@ -6764,8 +6764,8 @@ export interface MessageCreateOptions extends BaseMessageOptionsWithPoll {
|
||||||
|
stickers?: readonly StickerResolvable[];
|
||||||
|
flags?:
|
||||||
|
| BitFieldResolvable<
|
||||||
|
- Extract<MessageFlagsString, 'SuppressEmbeds' | 'SuppressNotifications'>,
|
||||||
|
- MessageFlags.SuppressEmbeds | MessageFlags.SuppressNotifications
|
||||||
|
+ Extract<MessageFlagsString, 'SuppressEmbeds' | 'SuppressNotifications' | 'Ephemeral'>,
|
||||||
|
+ MessageFlags.SuppressEmbeds | MessageFlags.SuppressNotifications | MessageFlags.Ephemeral
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user