mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
chore: format
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { parseDuration } from '$/utils/duration'
|
||||
import { ApplicationCommandOptionType, MessageFlags } from 'discord.js'
|
||||
import { unlinkSync, writeFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { inspect } from 'util'
|
||||
import { createContext, runInContext } from 'vm'
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { parseDuration } from '$/utils/duration'
|
||||
|
||||
export default new AdminCommand({
|
||||
name: 'eval',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApplicationCommandOptionType } from 'discord.js'
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { ApplicationCommandOptionType } from 'discord.js'
|
||||
|
||||
export default new AdminCommand({
|
||||
name: 'exception-test',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
import { type CommandInteraction, MessageFlags } from 'discord.js'
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
|
||||
export default new AdminCommand({
|
||||
name: 'reload',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ApplicationCommandOptionType, Routes } from 'discord.js'
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { ApplicationCommandOptionType, Routes } from 'discord.js'
|
||||
|
||||
const SubcommandOptions = {
|
||||
where: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
import { MessageFlags } from 'discord.js'
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
|
||||
export default new AdminCommand({
|
||||
name: 'stop',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EmbedBuilder, MessageFlags } from 'discord.js'
|
||||
import Command from '$/classes/Command'
|
||||
import { applyCommonEmbedStyles } from '$/utils/discord/embeds'
|
||||
import { EmbedBuilder, MessageFlags } from 'discord.js'
|
||||
|
||||
export default new Command({
|
||||
name: 'coinflip',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { ApplicationCommandOptionType, Message, MessageFlags } from 'discord.js'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { ModerationCommand } from '../../classes/Command'
|
||||
|
||||
export default new ModerationCommand({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MessageFlags } from 'discord.js'
|
||||
import { ModerationCommand } from '$/classes/Command'
|
||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { cureNickname } from '$/utils/discord/moderation'
|
||||
import { MessageFlags } from 'discord.js'
|
||||
|
||||
export default new ModerationCommand({
|
||||
name: 'cure',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EmbedBuilder } from 'discord.js'
|
||||
import { ModerationCommand } from '$/classes/Command'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { applyCommonEmbedStyles } from '$/utils/discord/embeds'
|
||||
import { EmbedBuilder } from 'discord.js'
|
||||
|
||||
export default new ModerationCommand({
|
||||
name: 'purge',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ChannelType } from 'discord.js'
|
||||
import { ModerationCommand } from '$/classes/Command'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { durationToString, parseDuration } from '$/utils/duration'
|
||||
import { ChannelType } from 'discord.js'
|
||||
|
||||
export default new ModerationCommand({
|
||||
name: 'slowmode',
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { and, eq } from 'drizzle-orm'
|
||||
import { ModerationCommand } from '$/classes/Command'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { appliedPresets } from '$/database/schemas'
|
||||
import { createModerationActionEmbed } from '$/utils/discord/embeds'
|
||||
import { sendModerationReplyAndLogs } from '$/utils/discord/moderation'
|
||||
import { removeRolePreset } from '$/utils/discord/rolePresets'
|
||||
import { and, eq } from 'drizzle-orm'
|
||||
|
||||
export default new ModerationCommand({
|
||||
name: 'unmute',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type FetchMessageOptions, MessageFlags, type MessageResolvable } from 'discord.js'
|
||||
import Command from '$/classes/Command'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { type FetchMessageOptions, MessageFlags, type MessageResolvable } from 'discord.js'
|
||||
import { config } from '../../../context'
|
||||
import type { ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type APIStringSelectComponent, ComponentType, MessageFlags } from 'discord.js'
|
||||
import Command from '$/classes/Command'
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { type APIStringSelectComponent, ComponentType, MessageFlags } from 'discord.js'
|
||||
import { config } from '../../../context'
|
||||
import type { ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { on, withContext } from '$utils/api/events'
|
||||
import { DisconnectReason, HumanizedDisconnectReason } from '@revanced/bot-shared'
|
||||
import { on, withContext } from '$utils/api/events'
|
||||
|
||||
withContext(on, 'disconnect', ({ api, config, logger }, reason, msg) => {
|
||||
if (reason === DisconnectReason.PlannedDisconnect && api.intentionallyDisconnecting) return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { and, eq, gt } from 'drizzle-orm'
|
||||
import { appliedPresets } from '$/database/schemas'
|
||||
import { on, withContext } from '$/utils/discord/events'
|
||||
import { applyRolesUsingPreset } from '$/utils/discord/rolePresets'
|
||||
import { and, eq, gt } from 'drizzle-orm'
|
||||
|
||||
withContext(on, 'guildMemberAdd', async ({ database }, member) => {
|
||||
const applieds = await database.query.appliedPresets.findMany({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MessageFlags } from 'discord.js'
|
||||
import CommandError from '$/classes/CommandError'
|
||||
import { createStackTraceEmbed } from '$utils/discord/embeds'
|
||||
import { on, withContext } from '$utils/discord/events'
|
||||
import { MessageFlags } from 'discord.js'
|
||||
|
||||
withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MessageFlags } from 'discord.js'
|
||||
import CommandError from '$/classes/CommandError'
|
||||
import { createStackTraceEmbed } from '$utils/discord/embeds'
|
||||
import { on, withContext } from '$utils/discord/events'
|
||||
import { MessageFlags } from 'discord.js'
|
||||
|
||||
withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||
if (!interaction.isContextMenuCommand()) return
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import { responses } from '$/database/schemas'
|
||||
import { handleUserResponseCorrection } from '$/utils/discord/messageScan'
|
||||
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$utils/discord/embeds'
|
||||
import { on, withContext } from '$utils/discord/events'
|
||||
import {
|
||||
type ButtonInteraction,
|
||||
MessageFlags,
|
||||
@@ -9,6 +5,10 @@ import {
|
||||
type TextBasedChannel,
|
||||
} from 'discord.js'
|
||||
import { eq } from 'drizzle-orm'
|
||||
import { responses } from '$/database/schemas'
|
||||
import { handleUserResponseCorrection } from '$/utils/discord/messageScan'
|
||||
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$utils/discord/embeds'
|
||||
import { on, withContext } from '$utils/discord/events'
|
||||
|
||||
// No permission check required as it is already done when the user reacts to a bot response
|
||||
withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { MessageFlags, type TextBasedChannel } from 'discord.js'
|
||||
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$utils/discord/embeds'
|
||||
import { on, withContext } from '$utils/discord/events'
|
||||
import { MessageFlags, type TextBasedChannel } from 'discord.js'
|
||||
|
||||
withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||
const {
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import { MessageScanLabeledResponseReactions as Reactions } from '$/constants'
|
||||
import { responses } from '$/database/schemas'
|
||||
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { on, withContext } from '$/utils/discord/events'
|
||||
import { handleUserResponseCorrection } from '$/utils/discord/messageScan'
|
||||
import { isAdmin } from '$/utils/discord/permissions'
|
||||
import {
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
@@ -12,6 +6,12 @@ import {
|
||||
StringSelectMenuOptionBuilder,
|
||||
} from 'discord.js'
|
||||
import { eq } from 'drizzle-orm'
|
||||
import { MessageScanLabeledResponseReactions as Reactions } from '$/constants'
|
||||
import { responses } from '$/database/schemas'
|
||||
import { createErrorEmbed, createStackTraceEmbed, createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { on, withContext } from '$/utils/discord/events'
|
||||
import { handleUserResponseCorrection } from '$/utils/discord/messageScan'
|
||||
import { isAdmin } from '$/utils/discord/permissions'
|
||||
import type { ConfigMessageScanResponseLabelConfig } from '$/../config.schema'
|
||||
|
||||
const PossibleReactions = Object.values(Reactions) as string[]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { type Client, DiscordAPIError } from 'discord.js'
|
||||
import { and, eq, lt } from 'drizzle-orm'
|
||||
import { database, logger } from '$/context'
|
||||
import { appliedPresets } from '$/database/schemas'
|
||||
import { on, withContext } from '$/utils/discord/events'
|
||||
import { removeRolePreset } from '$/utils/discord/rolePresets'
|
||||
import { type Client, DiscordAPIError } from 'discord.js'
|
||||
import { and, eq, lt } from 'drizzle-orm'
|
||||
|
||||
export default withContext(on, 'ready', async ({ config }, client) => {
|
||||
if (config.rolePresets) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { api, discord, logger } from '$/context'
|
||||
import { getMissingEnvironmentVariables } from '@revanced/bot-shared'
|
||||
import { api, discord, logger } from '$/context'
|
||||
|
||||
import './events/register'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DefaultEmbedColor, ReVancedLogoURL } from '$/constants'
|
||||
import { type APIEmbed, EmbedBuilder, type EmbedField, type JSONEncodable, type User } from 'discord.js'
|
||||
import { DefaultEmbedColor, ReVancedLogoURL } from '$/constants'
|
||||
import type { ConfigMessageScanResponseMessage } from '../../../config.schema'
|
||||
|
||||
export const createErrorEmbed = (title: string | null, description?: string) =>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type Response, responses } from '$/database/schemas'
|
||||
import { ButtonStyle, ComponentType } from 'discord.js'
|
||||
import { eq } from 'drizzle-orm'
|
||||
import { type Response, responses } from '$/database/schemas'
|
||||
import { createMessageScanResponseEmbed } from './embeds'
|
||||
import type { Config, ConfigMessageScanResponse, ConfigMessageScanResponseLabelConfig } from 'config.schema'
|
||||
import type { APIActionRowComponent, APIButtonComponent, Message, PartialUser, User } from 'discord.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { config, logger } from '$/context'
|
||||
import decancer from 'decancer'
|
||||
import { config, logger } from '$/context'
|
||||
import { applyReferenceToModerationActionEmbed, createModerationActionEmbed } from './embeds'
|
||||
import type { CommandInteraction, EmbedBuilder, Guild, GuildMember, Message, User } from 'discord.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { and, eq } from 'drizzle-orm'
|
||||
import { config, database } from '$/context'
|
||||
import { appliedPresets } from '$/database/schemas'
|
||||
import { and, eq } from 'drizzle-orm'
|
||||
import type { GuildMember } from 'discord.js'
|
||||
|
||||
// TODO: Fix this type
|
||||
|
||||
Reference in New Issue
Block a user