Removed Twitter bot

This commit is contained in:
TheEssem 2021-03-08 10:37:43 -06:00
parent 8c760a527d
commit 03aa3b3a2b
11 changed files with 1 additions and 185 deletions

View file

@ -1,20 +0,0 @@
const { writeFile } = require("fs");
const { promisify } = require("util");
const tweets = require("../tweets.json");
const twitter = require("../utils/twitter.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!`;
tweets[args[0]].push(args.slice(1).join(" "));
twitter.tweets = tweets;
await promisify(writeFile)("../tweets.json", JSON.stringify(tweets, null, 2));
return `${message.author.mention}, the content has been added.`;
};
exports.aliases = ["add"];
exports.category = 8;
exports.help = "Adds a tweet to the database";
exports.requires = "twitter";
exports.params = "[category] [message]";

View file

@ -1,15 +0,0 @@
const twitter = require("../utils/twitter.js");
exports.run = async (message, args) => {
if (message.author.id !== process.env.OWNER) return `${message.author.mention}, only the bot owner can tweet!`;
if (args.length === 0) return `${message.author.mention}, you need to provide some text to tweet!`;
const info = await twitter.client.statuses.update(args.join(" "));
//if (info.resp.statusCode !== 200) return `Something happened when trying to post this tweet: ${info.resp.statusCode} ${info.resp.statusMessage}`;
return `https://twitter.com/${process.env.HANDLE}/status/${info.id_str}`;
// with status code ${info.resp.statusCode} ${info.resp.statusMessage}.
};
exports.category = 8;
exports.help = "Tweets a message";
exports.requires = "twitter";
exports.params = "[message]";