ts settings update and fix
This commit is contained in:
parent
666638c956
commit
0a8017af72
21 changed files with 45 additions and 64 deletions
|
@ -1,6 +1,6 @@
|
|||
import { Client, ChatInputCommandInteraction, PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
|
||||
import * as AddMessageMacro from './messagemacro/add';
|
||||
|
@ -9,9 +9,7 @@ import { GuildInstance } from "../../database/schemas/Guild";
|
|||
import { UserInstance } from "../../database/schemas/User";
|
||||
|
||||
const data = {
|
||||
serverOnly: false,
|
||||
guildId: null,
|
||||
allowSuspendedUserAccess: true,
|
||||
allowSuspendedUserAccess: false,
|
||||
command: new SlashCommandBuilder()
|
||||
.setName('messagemacro')
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Client, ChatInputCommandInteraction, Role, GuildChannelResolvable, PermissionsBitField, ChannelType } from "discord.js";
|
||||
|
||||
import { schemas } from "../../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
|
||||
import { GuildInstance } from "../../../database/schemas/Guild";
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
} from "discord.js";
|
||||
|
||||
import { schemas } from "../../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from "mcstatusbot-logger";
|
||||
|
||||
import { GuildInstance } from "../../../database/schemas/Guild";
|
||||
|
@ -26,7 +26,7 @@ export async function chatInputCommand(client: Client, interaction: ChatInputCom
|
|||
|
||||
await interaction.deferReply();
|
||||
|
||||
let msgMacros = [];
|
||||
let msgMacros:MessageMacroAttributes[];
|
||||
try {
|
||||
const msgMacroDocs = await schemas["MessageMacro"].findAll({
|
||||
where: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client, ChatInputCommandInteraction, PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
|
||||
import * as AddReactionRole from './reactionrole/add';
|
||||
|
@ -9,9 +9,7 @@ import { GuildInstance } from "../../database/schemas/Guild";
|
|||
import { UserInstance } from "../../database/schemas/User";
|
||||
|
||||
const data = {
|
||||
serverOnly: false,
|
||||
guildId: null,
|
||||
allowSuspendedUserAccess: true,
|
||||
allowSuspendedUserAccess: false,
|
||||
command: new SlashCommandBuilder()
|
||||
.setName('reactionrole')
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Client, ChatInputCommandInteraction, Role, GuildChannelResolvable, Perm
|
|||
|
||||
import parseEmoji from "../../functions/parseEmoji";
|
||||
import { schemas } from "../../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
|
||||
import SendReactionRoleEmbed from "../../functions/SendReactionRoleEmbed";
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Client, ChatInputCommandInteraction, Role, GuildChannelResolvable, Text
|
|||
|
||||
import parseEmoji from "../../functions/parseEmoji";
|
||||
import { schemas } from "../../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
|
||||
import SendReactionRoleEmbed from "../../functions/SendReactionRoleEmbed";
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
import { Client, ChatInputCommandInteraction, PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
import { schemas } from "../../database/index";
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
import { GuildInstance } from "../../database/schemas/Guild";
|
||||
import { UserInstance } from "../../database/schemas/User";
|
||||
|
||||
|
||||
const data = {
|
||||
serverOnly: false,
|
||||
guildId: null,
|
||||
allowSuspendedUserAccess: true,
|
||||
allowSuspendedUserAccess: false,
|
||||
command: new SlashCommandBuilder()
|
||||
.setName('setprefix')
|
||||
.setDescription("sets the message prefix for your server")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client, MessageReaction, PartialMessageReaction, User, PartialUser, Guild, Role, GuildMember } from "discord.js";
|
||||
import { schemas } from "../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
export default async function ReactionRoleAddHandler(reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser) {
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { schemas } from "../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
import { GuildAttributes } from "../../database/schemas/Guild";
|
||||
import { Guild } from "discord.js";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { User } from "discord.js";
|
||||
import { schemas } from "../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
import { UserAttributes } from '../../database/schemas/User';
|
||||
export default async function LookupUser(user: User | null): Promise<UserAttributes | null> {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client, MessageReaction, PartialMessageReaction, User, PartialUser, Guild, Role, GuildMember, TextChannel } from "discord.js";
|
||||
import { schemas } from "../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
export default async function ReactionRoleAddHandler(reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser) {
|
||||
if (reaction.message.guild === undefined) return;
|
||||
|
@ -53,8 +53,8 @@ export default async function ReactionRoleAddHandler(reaction: MessageReaction |
|
|||
|
||||
//TODO: implement ignore reaction reomve when using this
|
||||
//reaction.users.remove(user.id);
|
||||
//@ts-expect-error
|
||||
const errUsrMsg = await channel.send(`Sorry <@!${user.id}>, that did not work please try again later or ask a moderator.`);
|
||||
|
||||
const errUsrMsg = await (channel as TextChannel).send(`Sorry <@!${user.id}>, that did not work please try again later or ask a moderator.`);
|
||||
|
||||
setTimeout(() => {
|
||||
errUsrMsg.delete().catch((e: any) => null);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client, MessageReaction, PartialMessageReaction, User, PartialUser, Guild, Role, GuildMember, TextChannel, flatten } from "discord.js";
|
||||
import { schemas } from "../../database";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
export default async function ReactionRoleRemoveHandler(reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser) {
|
||||
if (reaction.message.guild === undefined) return;
|
||||
|
@ -52,8 +52,8 @@ export default async function ReactionRoleRemoveHandler(reaction: MessageReactio
|
|||
if (process.env.DEBUG === 'true') YALAS.info(`Added role "${role.name}" to user "${user.tag}".`);
|
||||
} catch (error) {
|
||||
reaction.users.remove(user.id);
|
||||
//@ts-expect-error
|
||||
const errUsrMsg = await channel.send(`Sorry <@!${user.id}>, that did not work please try again later or ask a moderator.`);
|
||||
|
||||
const errUsrMsg = await (channel as TextChannel).send(`Sorry <@!${user.id}>, that did not work please try again later or ask a moderator.`);
|
||||
|
||||
setTimeout(() => {
|
||||
errUsrMsg.delete().catch((e: any) => null);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client, Interaction, ChatInputCommandInteraction, User } from "discord.js";
|
||||
import { schemas } from '../../database/index';
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
import LookupUser from "../functions/LookupUser";
|
||||
import LookupGuild from "../functions/LookupGuild";
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Client, Guild, Message } from "discord.js";
|
|||
import MessageMacro from "../messageHandler/plugins/MesageMacro";
|
||||
import { schemas } from "../../database";
|
||||
import LookupUser from "../functions/LookupUser";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
import { UserAttributes } from "../../database/schemas/User";
|
||||
import { GuildAttributes } from "../../database/schemas/Guild";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client, MessageReaction, PartialMessageReaction, User, PartialUser } from "discord.js";
|
||||
import ReactionRoleAddHandler from "../functions/ReactionRoleAddHandler";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
export default async function MessageReactionAdd(client: Client, reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser) {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client, MessageReaction, PartialMessageReaction, User, PartialUser } from "discord.js";
|
||||
import ReactionRoleRemoveHandler from "../functions/ReactionRoleRemoveHandler";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
export default async function MessageReactionRemove(client: Client, reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser) {
|
||||
if (!reaction.message.guild) return;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Client, ActivityType } from 'discord.js';
|
||||
//@ts-expect-error
|
||||
|
||||
import YALAS from 'mcstatusbot-logger';
|
||||
|
||||
export default function Ready(client: Client) {
|
||||
|
|
|
@ -4,13 +4,13 @@ import { GuildAttributes, GuildInstance } from "../../../database/schemas/Guild"
|
|||
import { MessageCreateOptions } from "../../../../types/MessageCreate";
|
||||
import { schemas } from "../../../database";
|
||||
import LookupGuild from "../../functions/LookupGuild";
|
||||
//@ts-expect-error
|
||||
|
||||
import * as YALAS from 'mcstatusbot-logger';
|
||||
|
||||
export default async function MessageMacro(client: Client, msg: Message, msgCmds: string[]) {
|
||||
if (msg.guild === null) return;
|
||||
if (msg.member === null) return;
|
||||
|
||||
|
||||
const guild: GuildAttributes | null = await LookupGuild(msg.guild);
|
||||
if (guild == null) return YALAS.error("MessageCreate guild null")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue