Added proper license, removed unused stuff, more twitter bot work
This commit is contained in:
parent
143319a7e2
commit
e1347fcf52
14 changed files with 81 additions and 27 deletions
13
commands/addtweet.js
Normal file
13
commands/addtweet.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const db = require("../utils/database.js");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (message.author.id !== process.env.OWNER) return `${message.author.mention}, only the bot owner can add tweets!`;
|
||||
if (args.length === 0) return `${message.author.mention}, you need to provide some text to add to the tweet database!`;
|
||||
if (args[1] === undefined) return `${message.author.mention}, you need to provide the content you want to add!`;
|
||||
const tweets = (await db.tweets.find({ enabled: true }).exec())[0];
|
||||
tweets[args[0]].push(args.slice(1).join(" "));
|
||||
await tweets.save();
|
||||
return `${message.author.mention}, the content has been added.`;
|
||||
};
|
||||
|
||||
exports.aliases = ["add"];
|
Loading…
Add table
Add a link
Reference in a new issue