Merge pull request #364 from VermiumSifell/dev

Minor fixes
This commit is contained in:
Axel Olausson Holtenäs 2022-06-13 14:17:56 +02:00 committed by GitHub
commit 1e30420eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 13 additions and 27 deletions

View file

@ -1,3 +1,4 @@
{ {
"extends": ["config:base"] "extends": ["config:base"],
"baseBranches": ["dev"]
} }

View file

@ -3,7 +3,6 @@ import { CommandInteraction, ButtonInteraction, Message } from "discord.js";
import logger from "../../logger"; import logger from "../../logger";
import getEmbedConfig from "../../helpers/getEmbedConfig";
import timeoutSchema from "../../models/timeout"; import timeoutSchema from "../../models/timeout";
import addSeconds from "../../helpers/addSeconds"; import addSeconds from "../../helpers/addSeconds";

View file

@ -1,8 +1,8 @@
import { CommandInteraction } from "discord.js"; import { ButtonInteraction } from "discord.js";
import logger from "../../../logger"; import logger from "../../../logger";
export const metadata = { guildOnly: false, ephemeral: false }; export const metadata = { guildOnly: false, ephemeral: false };
export const execute = async (interaction: CommandInteraction) => { export const execute = async (interaction: ButtonInteraction) => {
logger.debug("primary button clicked!"); logger.debug(interaction.customId, "primary button clicked!");
}; };

View file

@ -1,6 +1,5 @@
import { CommandInteraction } from "discord.js"; import { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders"; import { SlashCommandBuilder } from "@discordjs/builders";
import logger from "../../../logger";
import modules from "../../commands/counters/modules"; import modules from "../../commands/counters/modules";

View file

@ -4,7 +4,6 @@ import { CommandInteraction } from "discord.js";
// Groups // Groups
import modules from "../../commands/manage/modules"; import modules from "../../commands/manage/modules";
import logger from "../../../logger";
export const moduleData = modules; export const moduleData = modules;

View file

@ -1,6 +1,5 @@
import { CommandInteraction } from "discord.js"; import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders"; import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
import logger from "../../../../../logger";
import modules from "./modules"; import modules from "./modules";

View file

@ -6,7 +6,6 @@ import { CommandInteraction } from "discord.js";
import modules from "./modules"; import modules from "./modules";
// Handlers // Handlers
import logger from "../../../logger";
export const moduleData = modules; export const moduleData = modules;

View file

@ -37,8 +37,9 @@ export default {
execute: async (interaction: CommandInteraction) => { execute: async (interaction: CommandInteraction) => {
const { options, user, guild } = interaction; const { options, user, guild } = interaction;
const { errorColor, successColor, footerText, footerIcon } = const { successColor, footerText, footerIcon } = await getEmbedConfig(
await getEmbedConfig(guild); // Destructure guild
); // Destructure
const optionTarget = options?.getUser("target"); const optionTarget = options?.getUser("target");
const optionType = options?.getString("type"); const optionType = options?.getString("type");

View file

@ -16,7 +16,6 @@ import pluralize from "../../../../../helpers/pluralize";
import apiSchema from "../../../../../models/api"; import apiSchema from "../../../../../models/api";
import fetchUser from "../../../../../helpers/fetchUser"; import fetchUser from "../../../../../helpers/fetchUser";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { message } from "../../../../../helpers/cooldown/index";
export default { export default {
metadata: { guildOnly: true, ephemeral: true }, metadata: { guildOnly: true, ephemeral: true },

View file

@ -1,14 +1,9 @@
// Dependencies // Dependencies
import { import { CommandInteraction } from "discord.js";
CommandInteraction,
MessageActionRow,
MessageButton,
} from "discord.js";
// Configurations // Configurations
import getEmbedConfig from "../../../../../helpers/getEmbedConfig"; import getEmbedConfig from "../../../../../helpers/getEmbedConfig";
import { hosterName, hosterUrl } from "../../../../../config/other";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
// Function // Function

View file

@ -1,5 +1,5 @@
import logger from "../../../logger"; import logger from "../../../logger";
import { GuildMember, MessageEmbed, TextChannel } from "discord.js"; import { GuildMember, MessageEmbed } from "discord.js";
import guildSchema from "../../../models/guild"; import guildSchema from "../../../models/guild";

View file

@ -1,5 +1,5 @@
import logger from "../../../logger"; import logger from "../../../logger";
import { GuildMember, MessageEmbed, TextChannel } from "discord.js"; import { GuildMember, MessageEmbed } from "discord.js";
import guildSchema from "../../../models/guild"; import guildSchema from "../../../models/guild";

View file

@ -3,8 +3,6 @@ import { Interaction } from "discord.js";
import button from "./button"; import button from "./button";
import command from "./command"; import command from "./command";
import logger from "../../../../logger";
export const execute = async (interaction: Interaction) => { export const execute = async (interaction: Interaction) => {
await button(interaction); await button(interaction);
await command(interaction); await command(interaction);

View file

@ -14,9 +14,6 @@ export default {
if (author.bot) return; if (author.bot) return;
if (channel?.type !== "GUILD_TEXT") return; if (channel?.type !== "GUILD_TEXT") return;
const { id: guildId } = guild;
const { id: userId } = author;
const guildData = await fetchGuild(guild); const guildData = await fetchGuild(guild);
const userData = await fetchUser(author, guild); const userData = await fetchUser(author, guild);

View file

@ -29,7 +29,7 @@ export default async (message: Message) => {
await channel?.send(`${author} said **${word}**.`); await channel?.send(`${author} said **${word}**.`);
logger?.silly(`${author} said ${word} in ${channel}`); logger?.silly(`${author} said ${word} in ${channel}`);
}) })
?.catch(async (error: any) => { ?.catch(async (error) => {
logger?.error(error); logger?.error(error);
}); });
}; };

View file

@ -10,5 +10,5 @@ export const options: IEventOptions = {
}; };
export const execute = async (client: Client) => { export const execute = async (client: Client) => {
logger.warn("Discord's API client is rate-limited!"); logger.warn(`Discord's API client (${client?.user?.tag}) is rate-limited!`);
}; };