mirror of
https://github.com/danbulant/Shasha
synced 2026-06-09 01:20:58 +00:00
Split message not working
This commit is contained in:
parent
4df8b51463
commit
d23505a338
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue