2019-11-15 16:59:50 +00:00
|
|
|
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!`;
|
2020-03-14 23:03:45 +00:00
|
|
|
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}.
|
2019-11-30 02:00:14 +00:00
|
|
|
};
|
|
|
|
|
2019-12-02 20:47:22 +00:00
|
|
|
exports.category = 7;
|
|
|
|
exports.help = "Tweets a message";
|
2019-12-05 16:58:46 +00:00
|
|
|
exports.requires = "twitter";
|
|
|
|
exports.params = "[message]";
|