mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
const { Message, MessagePayload, APIMessage } = require('discord.js');
|
const { Message, MessagePayload, APIMessage } = require('discord.js');
|
||||||
|
|
||||||
Reflect.defineProperty(Message.prototype, 'say', { value: function (content, options) {
|
Reflect.defineProperty(Message.prototype, 'say', { value: function (content, options) {
|
||||||
return this.channel.send({ content: content || null, ...options });
|
if (typeof content === 'object') return this.channel.send(content);
|
||||||
|
return this.channel.send({ content, ...options });
|
||||||
} });
|
} });
|
||||||
|
|
||||||
Reflect.defineProperty(Message.prototype, 'embed', { value: function (embed, options) {
|
Reflect.defineProperty(Message.prototype, 'embed', { value: function (embed, options) {
|
||||||
@@ -9,9 +10,10 @@ Reflect.defineProperty(Message.prototype, 'embed', { value: function (embed, opt
|
|||||||
} });
|
} });
|
||||||
|
|
||||||
Reflect.defineProperty(Message.prototype, 'code', { value: function (lang, content, options) {
|
Reflect.defineProperty(Message.prototype, 'code', { value: function (lang, content, options) {
|
||||||
return this.channel.send({ content: content || null, lang, ...options });
|
return this.channel.send({ content, lang, ...options });
|
||||||
} });
|
} });
|
||||||
|
|
||||||
Reflect.defineProperty(Message.prototype, 'direct', { value: function (content, options) {
|
Reflect.defineProperty(Message.prototype, 'direct', { value: function (content, options) {
|
||||||
return this.author.send({ content: content || null, options });
|
if (typeof content === 'object') return this.author.send(content);
|
||||||
|
return this.author.send({ content, options });
|
||||||
} });
|
} });
|
||||||
|
|||||||
Reference in New Issue
Block a user