unnamed-lib
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "unnamed-lib", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A Discord Bot Lib.", | ||
@@ -5,0 +5,0 @@ "main": "src/main/index.js", |
@@ -5,3 +5,3 @@ # unnamed-lib | ||
Example: | ||
``` | ||
```js | ||
const Bot = require('unnamed-lib'); | ||
@@ -8,0 +8,0 @@ const bot = new Bot({ |
@@ -10,3 +10,3 @@ const { parseEmbedObject } = require('../util'); | ||
async function sendMessage(message, channel) { | ||
const embed = message?.toJSON && message?.toJSON instanceof Object ? message?.toJSON : (message && message instanceof Object ? parseEmbedObject(message) : {}); | ||
const embed = message?.toJSON?.() && message?.toJSON?.() instanceof Object ? message?.toJSON?.() : (message && message instanceof Object ? parseEmbedObject(message) : {}); | ||
let JsonBody = { | ||
@@ -52,3 +52,3 @@ content: `${message}`, | ||
async function editMessage(message, channel, messageId) { | ||
const embed = message?.toJSON && message?.toJSON instanceof Object ? message?.toJSON : (message && message instanceof Object ? parseEmbedObject(message) : {}); | ||
const embed = message?.toJSON?.() && message?.toJSON?.() instanceof Object ? message?.toJSON?.() : (message && message instanceof Object ? parseEmbedObject(message) : {}); | ||
let JsonBody = { | ||
@@ -55,0 +55,0 @@ content: `${message}`, |
@@ -158,5 +158,5 @@ const ws = require('ws'); | ||
try { | ||
const Function = require(`./functions/${file}`); | ||
const fn = require(`./functions/${file}`); | ||
Object.assign(Bot.prototype, Function); | ||
Object.assign(Bot.prototype, fn); | ||
} catch (err) { | ||
@@ -166,3 +166,1 @@ console.error(`Function ${file.slice(0, -3)} failed to load, error:\n${err}`); | ||
} | ||
module.exports = Object.assign(Bot); |
61818
1165