Split message not working

This commit is contained in:
Neko Life 2021-05-11 18:17:29 +00:00
parent 4df8b51463
commit d23505a338

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const { MessageEmbed, Message, GuildMember, User, Client, GuildChannel, Role } = require('discord.js'); const { MessageEmbed, Message, GuildMember, User, Client, GuildChannel, Role, MessageOptions } = require('discord.js');
const { defaultErrorLogChannel } = require("../config.json"); const { defaultErrorLogChannel } = require("../config.json");
const { database } = require("../database/mongo"); const { database } = require("../database/mongo");
@ -204,10 +204,10 @@ function noPerm(msg) {
* Send message * Send message
* @param {Client} client - (this.client) * @param {Client} client - (this.client)
* @param {Message | String} msg Message object | channel_ID * @param {Message | String} msg Message object | channel_ID
* @param {...any} content - ({content:content,optionblabla}) * @param {MessageOptions} content - ({content:content,optionblabla})
* @returns {Promise<Message>} Sent message object * @returns {Promise<Message>} Sent message object
*/ */
async function trySend(client, msg, ...content) { async function trySend(client, msg, content) {
//console.log(...content); //console.log(...content);
let msgOf; let msgOf;
if (msg?.channel) { if (msg?.channel) {
@ -215,7 +215,7 @@ async function trySend(client, msg, ...content) {
} else { } else {
msgOf = client.channels.cache.get(msg); msgOf = client.channels.cache.get(msg);
} }
const sentMes = await msgOf.send(...content) const sentMes = await msgOf.send(content)
.catch(() => { .catch(() => {
if (msg?.channel) { if (msg?.channel) {
noPerm(msg); noPerm(msg);