Live config for cleanup task
This commit is contained in:
@@ -3,11 +3,11 @@ module.exports = {
|
|||||||
immediate: true,
|
immediate: true,
|
||||||
name: 'Cleanup tasks',
|
name: 'Cleanup tasks',
|
||||||
async tick(client, timer) {
|
async tick(client, timer) {
|
||||||
const channelId = '1171410849269809232';
|
const channelId = '1170190197384814762';
|
||||||
const channel = await client.channels.fetch(channelId);
|
const channel = await client.channels.fetch(channelId);
|
||||||
|
|
||||||
|
console.log(`Running cleanup task for ${channel.guild.name}/${channel.name}`);
|
||||||
channel.messages.fetch({ limit: 100 }).then(messages => {
|
channel.messages.fetch({ limit: 100 }).then(messages => {
|
||||||
console.log(`Received ${messages.size} messages`);
|
|
||||||
//Iterate through the messages here with the variable "messages".
|
//Iterate through the messages here with the variable "messages".
|
||||||
messages.forEach(message => {
|
messages.forEach(message => {
|
||||||
if(message.attachments.size > 0) {
|
if(message.attachments.size > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user