mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 09:14:14 +02:00
refactor(db): move db functions to separate folders to aid distinguishing functions
This commit is contained in:
parent
325dc0d0d0
commit
a09b007831
@ -20,7 +20,7 @@
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Guild, Message } from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { getBalance } from '#utils/database/economy';
|
||||
import { getBalance } from '#utils/database/fun/economy';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
|
||||
export class BalanceCommand extends Command {
|
||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { Time } from '@sapphire/time-utilities';
|
||||
import type { User, Guild, GuildMember, Message } from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { daily, getLastDaily } from '#utils/database/economy';
|
||||
import { daily, getLastDaily } from '#utils/database/fun/economy';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Guild, Message } from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { getBalance, transfer } from '#utils/database/economy';
|
||||
import { getBalance, transfer } from '#utils/database/fun/economy';
|
||||
import { EmbedBuilder, TextChannel } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { N1984 } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
export class N1984Command extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { Cringe } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
export class CringeCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { Hugs } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
export class HugCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { Kill } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
export class KillCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { Poke } from '#utils/gifs';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun';
|
||||
import { addFunLog, countTotal } from '#utils/database/fun/fun';
|
||||
|
||||
export class PokeCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -21,9 +21,9 @@ import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Message, Snowflake, TextChannel, Guild } from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { addBan, checkBan } from '#utils/database/ban';
|
||||
import { addBan, checkBan } from '#utils/database/moderation/ban';
|
||||
import { addEmptyUser, updateUser } from '#utils/database/dbExistingUser';
|
||||
import { checkTempBan, removeTempBan } from '#utils/database/tempBan';
|
||||
import { checkTempBan, removeTempBan } from '#utils/database/moderation/tempBan';
|
||||
|
||||
export class BanCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -22,7 +22,7 @@ import { Duration, DurationFormatter } from '@sapphire/time-utilities';
|
||||
import type { User, Snowflake, TextChannel, Guild } from 'discord.js';
|
||||
import { EmbedBuilder, Message } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { addTempBan, checkTempBan } from '#utils/database/tempBan';
|
||||
import { addTempBan, checkTempBan } from '#utils/database/moderation/tempBan';
|
||||
import { addEmptyUser, updateUser } from '#utils/database/dbExistingUser';
|
||||
|
||||
export class TempBanCommand extends Command {
|
||||
|
@ -28,8 +28,8 @@ import type {
|
||||
} from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { removeBan, checkBan, addBan } from '#utils/database/ban';
|
||||
import { checkTempBan, removeTempBan } from '#utils/database/tempBan';
|
||||
import { removeBan, checkBan, addBan } from '#utils/database/moderation/ban';
|
||||
import { checkTempBan, removeTempBan } from '#utils/database/moderation/tempBan';
|
||||
import { addEmptyUser, addExistingUser } from '#utils/database/dbExistingUser';
|
||||
|
||||
export class UnbanCommand extends Command {
|
||||
|
@ -36,7 +36,7 @@ import {
|
||||
updateUser,
|
||||
fetchRoles,
|
||||
} from '#utils/database/dbExistingUser';
|
||||
import { restrict, checkActive } from '#utils/database/restriction';
|
||||
import { restrict, checkActive } from '#utils/database/moderation/restriction';
|
||||
import { randint } from '#utils/maths';
|
||||
import { blockedRolesAfterRestricted } from '#utils/blockedRoles';
|
||||
|
||||
|
@ -21,7 +21,7 @@ import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { ChannelType, EmbedBuilder } from 'discord.js';
|
||||
import type { Message, TextChannel, Guild, Snowflake } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { getRestrictions } from '#utils/database/restriction';
|
||||
import { getRestrictions } from '#utils/database/moderation/restriction';
|
||||
import { checkStaff } from '#utils/checker';
|
||||
|
||||
export class RestrictLogsCommand extends Command {
|
||||
|
@ -26,7 +26,7 @@ import {
|
||||
unRestrict,
|
||||
checkActive,
|
||||
unRestrictLegacy,
|
||||
} from '#utils/database/restriction';
|
||||
} from '#utils/database/moderation/restriction';
|
||||
|
||||
export class UnRestrictCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -39,7 +39,7 @@ import {
|
||||
getNote,
|
||||
deactivateNote,
|
||||
deactivateAllNotes,
|
||||
} from '#utils/database/sus';
|
||||
} from '#utils/database/moderation/sus';
|
||||
import { checkStaff } from '#utils/checker';
|
||||
import IDs from '#utils/ids';
|
||||
import { createSusLogEmbed } from '#utils/embeds';
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { GuildMember, Message } from 'discord.js';
|
||||
import { addMute, removeMute, checkActive } from '#utils/database/vcMute';
|
||||
import { addMute, removeMute, checkActive } from '#utils/database/moderation/vcMute';
|
||||
import { addExistingUser } from '#utils/database/dbExistingUser';
|
||||
|
||||
export class VCMuteCommand extends Command {
|
||||
|
@ -21,7 +21,7 @@ import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { EmbedBuilder, TextChannel } from 'discord.js';
|
||||
import type { Message, Guild, User } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { deleteWarning, fetchWarning } from '#utils/database/warnings';
|
||||
import { deleteWarning, fetchWarning } from '#utils/database/moderation/warnings';
|
||||
import { checkStaff } from '#utils/checker';
|
||||
|
||||
export class DeleteWarningCommand extends Command {
|
||||
|
@ -25,7 +25,7 @@ import {
|
||||
} from '@sapphire/framework';
|
||||
import type { User, Message, Snowflake, Guild, TextChannel } from 'discord.js';
|
||||
import { updateUser } from '#utils/database/dbExistingUser';
|
||||
import { addWarn } from '#utils/database/warnings';
|
||||
import { addWarn } from '#utils/database/moderation/warnings';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
|
@ -21,7 +21,7 @@ import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import { ChannelType, EmbedBuilder } from 'discord.js';
|
||||
import type { Message, Guild, User } from 'discord.js';
|
||||
import IDs from '#utils/ids';
|
||||
import { fetchWarnings } from '#utils/database/warnings';
|
||||
import { fetchWarnings } from '#utils/database/moderation/warnings';
|
||||
import { checkStaff } from '#utils/checker';
|
||||
import { createWarningsEmbed } from '#utils/embeds';
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Args, Command, RegisterBehavior } from '@sapphire/framework';
|
||||
import type { User, Guild, Message } from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { getRank, xpToNextLevel } from '#utils/database/xp';
|
||||
import { getRank, xpToNextLevel } from '#utils/database/fun/xp';
|
||||
|
||||
export class RankCommand extends Command {
|
||||
public constructor(context: Command.LoaderContext, options: Command.Options) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Listener } from '@sapphire/framework';
|
||||
import type { GuildBan } from 'discord.js';
|
||||
import { AuditLogEvent, EmbedBuilder, TextChannel } from 'discord.js';
|
||||
import { addBan, checkBan } from '#utils/database/ban';
|
||||
import { addBan, checkBan } from '#utils/database/moderation/ban';
|
||||
import IDs from '#utils/ids';
|
||||
import { addEmptyUser, addExistingUser } from '#utils/database/dbExistingUser';
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
import { Listener } from '@sapphire/framework';
|
||||
import type { GuildMember } from 'discord.js';
|
||||
import { checkBan, getBanReason } from '#utils/database/ban';
|
||||
import { checkTempBan } from '#utils/database/tempBan';
|
||||
import { checkBan, getBanReason } from '#utils/database/moderation/ban';
|
||||
import { checkTempBan } from '#utils/database/moderation/tempBan';
|
||||
|
||||
export class BanJoinListener extends Listener {
|
||||
public constructor(
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { Listener } from '@sapphire/framework';
|
||||
import type { GuildBan } from 'discord.js';
|
||||
import { AuditLogEvent, EmbedBuilder, TextChannel } from 'discord.js';
|
||||
import { addBan, checkBan, removeBan } from '#utils/database/ban';
|
||||
import { addBan, checkBan, removeBan } from '#utils/database/moderation/ban';
|
||||
import IDs from '#utils/ids';
|
||||
import { addEmptyUser, addExistingUser } from '#utils/database/dbExistingUser';
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
import { Listener } from '@sapphire/framework';
|
||||
import type { Message } from 'discord.js';
|
||||
import { getLastCount, addCount } from '#utils/database/counting';
|
||||
import { getLastCount, addCount } from '#utils/database/fun/counting';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class XpListener extends Listener {
|
||||
|
@ -22,14 +22,14 @@ import { ChannelType } from 'discord.js';
|
||||
import type { GuildChannel, EmbedBuilder } from 'discord.js';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
import IDs from '#utils/ids';
|
||||
import { checkActive, getRestrictions } from '#utils/database/restriction';
|
||||
import { findNotes } from '#utils/database/sus';
|
||||
import { checkActive, getRestrictions } from '#utils/database/moderation/restriction';
|
||||
import { findNotes } from '#utils/database/moderation/sus';
|
||||
import {
|
||||
createRestrictLogEmbed,
|
||||
createSusLogEmbed,
|
||||
createWarningsEmbed,
|
||||
} from '#utils/embeds';
|
||||
import { fetchWarnings } from '#utils/database/warnings';
|
||||
import { fetchWarnings } from '#utils/database/moderation/warnings';
|
||||
|
||||
export class ModMailCreateListener extends Listener {
|
||||
public constructor(
|
||||
|
@ -28,7 +28,7 @@ import type {
|
||||
import { ChannelType } from 'discord.js';
|
||||
import { fetchRoles, getLeaveRoles } from '#utils/database/dbExistingUser';
|
||||
import { blockTime } from '#utils/database/verification';
|
||||
import { checkActive, getSection } from '#utils/database/restriction';
|
||||
import { checkActive, getSection } from '#utils/database/moderation/restriction';
|
||||
import { blockedRoles, blockedRolesAfterRestricted } from '#utils/blockedRoles';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
import { Listener } from '@sapphire/framework';
|
||||
import type { VoiceState } from 'discord.js';
|
||||
import { checkActive, removeMute } from '#utils/database/vcMute';
|
||||
import { checkActive, removeMute } from '#utils/database/moderation/vcMute';
|
||||
|
||||
export class VCMuteListener extends Listener {
|
||||
public constructor(
|
||||
|
@ -50,7 +50,7 @@ import {
|
||||
startVerification,
|
||||
finishVerification,
|
||||
} from '#utils/database/verification';
|
||||
import { findNotes } from '#utils/database/sus';
|
||||
import { findNotes } from '#utils/database/moderation/sus';
|
||||
import { addExistingUser } from '#utils/database/dbExistingUser';
|
||||
import { rolesToString } from '#utils/formatter';
|
||||
import IDs from '#utils/ids';
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
import { Listener } from '@sapphire/framework';
|
||||
import type { Message } from 'discord.js';
|
||||
import { addXp, checkCanAddXp } from '#utils/database/xp';
|
||||
import { addXp, checkCanAddXp } from '#utils/database/fun/xp';
|
||||
import { randint } from '#utils/maths';
|
||||
|
||||
export class XpListener extends Listener {
|
||||
|
@ -20,8 +20,8 @@
|
||||
import { ScheduledTask } from '@sapphire/plugin-scheduled-tasks';
|
||||
import IDs from '#utils/ids';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { checkBan } from '#utils/database/ban';
|
||||
import { checkTempBan, removeTempBan } from '#utils/database/tempBan';
|
||||
import { checkBan } from '#utils/database/moderation/ban';
|
||||
import { checkTempBan, removeTempBan } from '#utils/database/moderation/tempBan';
|
||||
|
||||
export class TempBan extends ScheduledTask {
|
||||
public constructor(
|
||||
|
@ -18,9 +18,9 @@
|
||||
*/
|
||||
import type { Guild, User } from 'discord.js';
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import type { SusNotes } from '#utils/database/sus';
|
||||
import { RestrictionLogs } from '#utils/database/restriction';
|
||||
import { Warnings } from '#utils/database/warnings';
|
||||
import type { SusNotes } from '#utils/database/moderation/sus';
|
||||
import { RestrictionLogs } from '#utils/database/moderation/restriction';
|
||||
import { Warnings } from '#utils/database/moderation/warnings';
|
||||
|
||||
export function createSusLogEmbed(notes: SusNotes, user: User, guild: Guild) {
|
||||
const embed = new EmbedBuilder()
|
||||
|
Loading…
x
Reference in New Issue
Block a user