mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 02:33:06 +00:00
chore: update and clean up imports
This commit is contained in:
parent
d9d5f087e7
commit
9aabe2885b
30 changed files with 78 additions and 84 deletions
|
@ -1,7 +1,7 @@
|
|||
# Poixpixel's Discord Bot
|
||||
|
||||
> [!WARNING]
|
||||
> This Discord bot is not production ready.
|
||||
> This Discord bot is not production ready and is still in a testing state.
|
||||
|
||||
> [!TIP]
|
||||
> Want to see the bot in action? [Join our Discord server](https://discord.gg/KRTGjxx7gY).
|
||||
|
|
|
@ -4,9 +4,9 @@ import {
|
|||
PermissionsBitField,
|
||||
} from 'discord.js';
|
||||
|
||||
import { SubcommandCommand } from '../../types/CommandTypes.js';
|
||||
import { getCountingData, setCount } from '../../util/countingManager.js';
|
||||
import { loadConfig } from '../../util/configLoader.js';
|
||||
import { SubcommandCommand } from '@/types/CommandTypes.js';
|
||||
import { getCountingData, setCount } from '@/util/countingManager.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
|
||||
const command: SubcommandCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -13,10 +13,10 @@ import {
|
|||
approveFact,
|
||||
deleteFact,
|
||||
getLastInsertedFactId,
|
||||
} from '../../db/db.js';
|
||||
import { postFactOfTheDay } from '../../util/factManager.js';
|
||||
import { loadConfig } from '../../util/configLoader.js';
|
||||
import { SubcommandCommand } from '../../types/CommandTypes.js';
|
||||
} from '@/db/db.js';
|
||||
import { postFactOfTheDay } from '@/util/factManager.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
import { SubcommandCommand } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: SubcommandCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -9,8 +9,8 @@ import {
|
|||
JSONEncodable,
|
||||
} from 'discord.js';
|
||||
|
||||
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||
import { getLevelLeaderboard } from '../../db/db.js';
|
||||
import { OptionsCommand } from '@/types/CommandTypes.js';
|
||||
import { getLevelLeaderboard } from '@/db/db.js';
|
||||
|
||||
const command: OptionsCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||
import {
|
||||
generateRankCard,
|
||||
getXpToNextLevel,
|
||||
} from '../../util/levelingSystem.js';
|
||||
import { getUserLevel } from '../../db/db.js';
|
||||
import { OptionsCommand } from '@/types/CommandTypes.js';
|
||||
import { generateRankCard, getXpToNextLevel } from '@/util/levelingSystem.js';
|
||||
import { getUserLevel } from '@/db/db.js';
|
||||
|
||||
const command: OptionsCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { updateMember, updateMemberModerationHistory } from '../../db/db.js';
|
||||
import { parseDuration, scheduleUnban } from '../../util/helpers.js';
|
||||
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||
import logAction from '../../util/logging/logAction.js';
|
||||
import { updateMember, updateMemberModerationHistory } from '@/db/db.js';
|
||||
import { parseDuration, scheduleUnban } from '@/util/helpers.js';
|
||||
import { OptionsCommand } from '@/types/CommandTypes.js';
|
||||
import logAction from '@/util/logging/logAction.js';
|
||||
|
||||
const command: OptionsCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { executeUnban } from '../../util/helpers.js';
|
||||
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||
import { executeUnban } from '@/util/helpers.js';
|
||||
import { OptionsCommand } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: OptionsCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { updateMemberModerationHistory } from '../../db/db.js';
|
||||
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||
import logAction from '../../util/logging/logAction.js';
|
||||
import { updateMemberModerationHistory } from '@/db/db.js';
|
||||
import { OptionsCommand } from '@/types/CommandTypes.js';
|
||||
import logAction from '@/util/logging/logAction.js';
|
||||
|
||||
const command: OptionsCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { updateMember } from '../../db/db.js';
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { updateMember } from '@/db/db.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -9,8 +9,8 @@ import {
|
|||
JSONEncodable,
|
||||
} from 'discord.js';
|
||||
|
||||
import { getAllMembers } from '../../db/db.js';
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { getAllMembers } from '@/db/db.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { recalculateUserLevels } from '../../util/levelingSystem.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
import { recalculateUserLevels } from '@/util/levelingSystem.js';
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -4,17 +4,14 @@ import {
|
|||
SlashCommandBuilder,
|
||||
} from 'discord.js';
|
||||
|
||||
import { SubcommandCommand } from '../../types/CommandTypes.js';
|
||||
import { loadConfig } from '../../util/configLoader.js';
|
||||
import {
|
||||
initializeDatabaseConnection,
|
||||
ensureDbInitialized,
|
||||
} from '../../db/db.js';
|
||||
import { isRedisConnected } from '../../db/redis.js';
|
||||
import { SubcommandCommand } from '@/types/CommandTypes.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
import { initializeDatabaseConnection, ensureDbInitialized } from '@/db/db.js';
|
||||
import { isRedisConnected } from '@/db/redis.js';
|
||||
import {
|
||||
NotificationType,
|
||||
notifyManagers,
|
||||
} from '../../util/notificationHandler.js';
|
||||
} from '@/util/notificationHandler.js';
|
||||
|
||||
const command: SubcommandCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
@ -123,7 +120,7 @@ async function handleRedisReconnect(interaction: CommandInteraction) {
|
|||
await interaction.editReply('Attempting to reconnect to Redis...');
|
||||
|
||||
try {
|
||||
const redisModule = await import('../../db/redis.js');
|
||||
const redisModule = await import('@/db/redis.js');
|
||||
|
||||
await redisModule.ensureRedisConnection();
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@ import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
|||
import { exec } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { loadConfig } from '../../util/configLoader.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
import {
|
||||
NotificationType,
|
||||
notifyManagers,
|
||||
} from '../../util/notificationHandler.js';
|
||||
import { isRedisConnected } from '../../db/redis.js';
|
||||
import { ensureDatabaseConnection } from '../../db/db.js';
|
||||
} from '@/util/notificationHandler.js';
|
||||
import { isRedisConnected } from '@/db/redis.js';
|
||||
import { ensureDatabaseConnection } from '@/db/db.js';
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
|
||||
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
|
||||
const rulesEmbed = new EmbedBuilder()
|
||||
.setColor(0x0099ff)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { Command } from '../../types/CommandTypes.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -5,8 +5,8 @@ import {
|
|||
PermissionsBitField,
|
||||
} from 'discord.js';
|
||||
|
||||
import { getMember } from '../../db/db.js';
|
||||
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||
import { getMember } from '@/db/db.js';
|
||||
import { OptionsCommand } from '@/types/CommandTypes.js';
|
||||
|
||||
const command: OptionsCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { SubcommandCommand } from '../../types/CommandTypes.js';
|
||||
import { addXpToUser, getUserLevel } from '../../db/db.js';
|
||||
import { loadConfig } from '../../util/configLoader.js';
|
||||
import { SubcommandCommand } from '@/types/CommandTypes.js';
|
||||
import { addXpToUser, getUserLevel } from '@/db/db.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
|
||||
const command: SubcommandCommand = {
|
||||
data: new SlashCommandBuilder()
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import Redis from 'ioredis';
|
||||
import { Client } from 'discord.js';
|
||||
|
||||
import { loadConfig } from '../util/configLoader.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
import {
|
||||
logManagerNotification,
|
||||
NotificationType,
|
||||
notifyManagers,
|
||||
} from '../util/notificationHandler.js';
|
||||
} from '@/util/notificationHandler.js';
|
||||
|
||||
const config = loadConfig();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GatewayIntentBits } from 'discord.js';
|
||||
import { ExtendedClient } from './structures/ExtendedClient.js';
|
||||
import { loadConfig } from './util/configLoader.js';
|
||||
import { ExtendedClient } from '@/structures/ExtendedClient.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
|
||||
async function startBot() {
|
||||
try {
|
||||
|
|
|
@ -7,9 +7,9 @@ import {
|
|||
PermissionOverwrites,
|
||||
} from 'discord.js';
|
||||
|
||||
import { ChannelLogAction } from '../util/logging/types.js';
|
||||
import { Event } from '../types/EventTypes.js';
|
||||
import logAction from '../util/logging/logAction.js';
|
||||
import { ChannelLogAction } from '@/util/logging/types.js';
|
||||
import { Event } from '@/types/EventTypes.js';
|
||||
import logAction from '@/util/logging/logAction.js';
|
||||
|
||||
function arePermissionsEqual(
|
||||
oldPerms: Map<string, PermissionOverwrites>,
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import {
|
||||
Collection,
|
||||
Events,
|
||||
Guild,
|
||||
GuildMember,
|
||||
PartialGuildMember,
|
||||
} from 'discord.js';
|
||||
|
||||
import { updateMember, setMembers } from '../db/db.js';
|
||||
import { generateMemberBanner } from '../util/helpers.js';
|
||||
import { loadConfig } from '../util/configLoader.js';
|
||||
import { Event } from '../types/EventTypes.js';
|
||||
import logAction from '../util/logging/logAction.js';
|
||||
import { updateMember, setMembers } from '@/db/db.js';
|
||||
import { generateMemberBanner } from '@/util/helpers.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
import { Event } from '@/types/EventTypes.js';
|
||||
import logAction from '@/util/logging/logAction.js';
|
||||
|
||||
export const memberJoin: Event<typeof Events.GuildMemberAdd> = {
|
||||
name: Events.GuildMemberAdd,
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { AuditLogEvent, Events, Message, PartialMessage } from 'discord.js';
|
||||
|
||||
import { Event } from '../types/EventTypes.js';
|
||||
import { loadConfig } from '../util/configLoader.js';
|
||||
import { Event } from '@/types/EventTypes.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
import {
|
||||
addCountingReactions,
|
||||
processCountingMessage,
|
||||
resetCounting,
|
||||
} from '../util/countingManager.js';
|
||||
import logAction from '../util/logging/logAction.js';
|
||||
} from '@/util/countingManager.js';
|
||||
import logAction from '@/util/logging/logAction.js';
|
||||
import {
|
||||
checkAndAssignLevelRoles,
|
||||
processMessage,
|
||||
} from '../util/levelingSystem.js';
|
||||
} from '@/util/levelingSystem.js';
|
||||
|
||||
export const messageDelete: Event<typeof Events.MessageDelete> = {
|
||||
name: Events.MessageDelete,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { AuditLogEvent, Events, Role } from 'discord.js';
|
||||
|
||||
import { Event } from '../types/EventTypes.js';
|
||||
import logAction from '../util/logging/logAction.js';
|
||||
import { Event } from '@/types/EventTypes.js';
|
||||
import logAction from '@/util/logging/logAction.js';
|
||||
|
||||
const convertRoleProperties = (role: Role) => ({
|
||||
name: role.name,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Client, ClientOptions, Collection } from 'discord.js';
|
||||
import { Command } from '../types/CommandTypes.js';
|
||||
import { Config } from '../types/ConfigTypes.js';
|
||||
import { deployCommands } from '../util/deployCommand.js';
|
||||
import { registerEvents } from '../util/eventLoader.js';
|
||||
import { Command } from '@/types/CommandTypes.js';
|
||||
import { Config } from '@/types/ConfigTypes.js';
|
||||
import { deployCommands } from '@/util/deployCommand.js';
|
||||
import { registerEvents } from '@/util/eventLoader.js';
|
||||
|
||||
/**
|
||||
* Extended client class that extends the default Client class
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { Config } from '../types/ConfigTypes.js';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
import { Config } from '@/types/ConfigTypes.js';
|
||||
|
||||
/**
|
||||
* Loads the config file from the root directory
|
||||
* @returns - The loaded config object
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Message } from 'discord.js';
|
||||
|
||||
import { getJson, setJson } from '../db/redis.js';
|
||||
import { getJson, setJson } from '@/db/redis.js';
|
||||
|
||||
interface CountingData {
|
||||
currentCount: number;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { EmbedBuilder, Client } from 'discord.js';
|
||||
|
||||
import { getRandomUnusedFact, markFactAsUsed } from '../db/db.js';
|
||||
import { getRandomUnusedFact, markFactAsUsed } from '@/db/db.js';
|
||||
import { loadConfig } from './configLoader.js';
|
||||
|
||||
let isFactScheduled = false;
|
||||
|
|
|
@ -8,8 +8,8 @@ import {
|
|||
getUserLevel,
|
||||
getUserRank,
|
||||
handleDbError,
|
||||
} from '../db/db.js';
|
||||
import * as schema from '../db/schema.js';
|
||||
} from '@/db/db.js';
|
||||
import * as schema from '@/db/schema.js';
|
||||
import { loadConfig } from './configLoader.js';
|
||||
import { roundRect } from './helpers.js';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue