Compare commits

...

4 commits

Author SHA1 Message Date
7d0a7f6873 remove fetchAllmembers
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
2020-11-24 17:16:36 +01:00
c85fc872ab more logging for tweet so it can actually be used to report users
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
2020-11-24 17:16:15 +01:00
16d71a22e6 remove author and expose stats
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
2020-11-24 17:15:53 +01:00
59bc18fda6 fetch guild members to (hopefully) fix the intent issues
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
2020-11-24 17:15:36 +01:00
6 changed files with 29 additions and 15 deletions

View file

@ -46,7 +46,7 @@ class tweetCommand extends Command {
const blacklist = await TwitterBlacklist.findOne({where: {userID:message.author.id}});
if (blacklist) {
return message.channel.send(`You have been blacklisted for the following reasons: \`\`${blacklist.get('reason')}\`\` be less naughty next time.`);
return message.channel.send(`You have been blacklisted for the following reasons: \`${blacklist.get('reason')}\` be less naughty next time.`);
}
// Don't let account new account use this command to prevent spam
if (message.author.createdAt > date.setDate(date.getDate() - 7)) {
@ -157,28 +157,27 @@ class tweetCommand extends Command {
}
const tweetid = response.id_str;
const publicEmbed = client.util.embed()
.setAuthor('Some user of discord said...')
.setDescription(text)
.addField('Link', `https://twitter.com/i/status/${tweetid}`)
.setTimestamp();
if (Attachment[0]) publicEmbed.setImage(Attachment[0].url);
// Im too lazy for now to make an entry in config.json
let channel = client.channels.resolve('597964498921455637');
channel.send({embed: publicEmbed});
channel.send(`https://twitter.com/i/status/${tweetid}`);
const Embed = client.util.embed()
.setAuthor(message.author.username, message.author.displayAvatarURL())
.setDescription(args.text)
.addField('Link', `https://twitter.com/i/status/${tweetid}`, true)
.addField('Tweet ID', tweetid, true)
.addField('Channel ID', message.channel.id, true)
.addField('Messsage ID', message.id, true)
.addField('Author', `${message.author.username} (${message.author.id})`, true)
.setTimestamp();
if (message.guild) Embed.addField('Guild', `${message.guild.name} (${message.guild.id})`, true);
if (message.guild) {
Embed.addField('Guild', `${message.guild.name} (${message.guild.id})`, true);
Embed.addField('Message link', `https://discord.com/channels/${message.guild.id}/${message.channel.id}/${message.id}`);
} else {
Embed.addField('Message link', `https://discord.com/channels/@me/${message.channel.id}/${message.id}`);
}
if (Attachment[0]) Embed.setImage(Attachment[0].url);

View file

@ -32,6 +32,8 @@ class messageListener extends Listener {
});
}
await message.guild.members.fetch();
if (message.author.bot) return;
/* Banned words section

View file

@ -26,6 +26,8 @@ class MessageReactionAddListener extends Listener {
});
}
await reaction.message.guild.members.fetch();
let starboardChannel, shameboardChannel;
let reactionCount = reaction.count;

View file

@ -11,6 +11,13 @@ class messageReactionRemoveListener extends Listener {
}
async exec(reaction) {
if (reaction.partial) {
await reaction.fetch()
.catch(err => {
return console.error(err);
});
}
if (reaction.message.partial) {
await reaction.message.fetch()
.catch(err => {
@ -18,6 +25,8 @@ class messageReactionRemoveListener extends Listener {
});
}
await reaction.message.guild.members.fetch();
let starboardChannel, shameboardChannel;
let reactionCount = reaction.count;

View file

@ -16,6 +16,7 @@ class ReadyListener extends Listener {
}
async exec() {
console.log(this.client.users.cache.size);
let commandSize = this.client.commandHandler.modules.size;
let clientTag = this.client.user.tag;
let guildSize = this.client.guilds.cache.size;
@ -23,7 +24,7 @@ class ReadyListener extends Listener {
let channelSize = this.client.channels.cache.size;
let profilePicture = this.client.user.displayAvatarURL();
let clientID = this.client.user.id;
let author = this.client.users.resolve(ownerID).tag;
//let author = this.client.users.resolve(ownerID).tag;
// Send stats to the console
@ -57,7 +58,7 @@ class ReadyListener extends Listener {
status = status.replace('${prefix}', prefix[0]);
client.user.setActivity(`${status} | My prefix is: ${prefix[0]}`, { type: 'PLAYING' });
} else if (random === 2 && owner.presence.activities != null) { // Bot owner status
} /* else if (random === 2 && owner.presence.activities != null) { // Bot owner status
console.log('Status type: \x1b[32mCopying owner status\x1b[0m');
// Get elapsed time from when the activity started
let diffMins = 0;
@ -69,7 +70,7 @@ class ReadyListener extends Listener {
client.user.setActivity(`${owner.presence.activities[0].name}\nfor ${diffMins} minutes | My prefix is: ${prefix[0]}`, owner.presence.activities[0]);
}
}
} */
}
@ -80,6 +81,7 @@ class ReadyListener extends Listener {
}
// Expose stats
/*
if (exposeStats) {
const port = 3000;
@ -120,6 +122,7 @@ class ReadyListener extends Listener {
});
console.log(`Exposing stats on port ${port}`);
}
*/
console.log('===========[ READY ]===========');

View file

@ -23,8 +23,7 @@ class hahaYesClient extends AkairoClient {
}, {
partials: ['MESSAGE'],
disableMentions: 'everyone',
ws: { intents: intents },
fetchAllMembers: true
ws: { intents: intents }
});
this.commandHandler = new CommandHandler(this, {