function monitor(discord) {
    discord.on('messageCreate', async (message) => {
        // ignore posts from bots
        if (message.author.bot) return;
    
        // ignore posts from mods
        if (message.member.permissions.has(DiscordApi.Permissions.FLAGS.MANAGE_MESSAGES)) return;

        var guildId = message.guild.id;
        var userId = message.member.id;
    
        try {
            // possible spam.  Does it have a URL?
            var urlsFound = extractUrlsFromContent(message.content);
        
            for (var i = 0; i < urlsFound.length; i++) {
                // see if the message content contains a gif
                if (await checkIfIsRestricted(urlsFound[i]) || await checkIfIsRestricted(urlsFound[i] + ".gif")) {
                    await restrictedContentEncountered(message, userId, guildId);
                }
            }

            if (message.attachments && message.attachments.size > 0) {
                // evaluate the attachments
                for (let file of message.attachments) {
                    if (file && file.length > 1 && file[1].contentType === "image/gif") {
                        await restrictedContentEncountered(message, userId, guildId);
                    }
                }
            }
        } catch (err) {
            // something went wrong when assessing the message content
            try {
                await recordError(guildId, userId, err, reason);
            } catch (err2) {
                await recordError("", "", err2, reason);
            }
        }
    });
 }
/**
 * @description Looks for nitro/steam scams and removes them
 * @param {DiscordApi.Client} discord The discord client
 */
@description Looks for nitro/steam scams and removes them
@param {DiscordApi.Client} discord The discord client
@description Looks for nitro / steam scams and removes them @param { DiscordApi . Client } discord The discord client
function monitor(discord) {
    discord.on('messageCreate', async (message) => {
        if (message.author.bot) return;
        if (message.member.permissions.has(DiscordApi.Permissions.FLAGS.MANAGE_MESSAGES)) return;
        var guildId = message.guild.id;
        var userId = message.member.id;
        try {
            var urlsFound = extractUrlsFromContent(message.content);
            for (var i = 0; i < urlsFound.length; i++) {
                if (await checkIfIsRestricted(urlsFound[i]) || await checkIfIsRestricted(urlsFound[i] + ".gif")) {
                    await restrictedContentEncountered(message, userId, guildId);
                }
            }
            if (message.attachments && message.attachments.size > 0) {
                for (let file of message.attachments) {
                    if (file && file.length > 1 && file[1].contentType === "image/gif") {
                        await restrictedContentEncountered(message, userId, guildId);
                    }
                }
            }
        } catch (err) {
            try {
                await recordError(guildId, userId, err, reason);
            } catch (err2) {
                await recordError("", "", err2, reason);
            }
        }
    });
 }
function monitor ( discord ) { discord . on ( 'messageCreate' , async ( message ) => { if ( message . author . bot ) return ; if ( message . member . permissions . has ( DiscordApi . Permissions . FLAGS . MANAGE_MESSAGES ) ) return ; var guildId = message . guild . id ; var userId = message . member . id ; try { var urlsFound = extractUrlsFromContent ( message . content ) ; for ( var i = 0 ; i < urlsFound . length ; i ++ ) { if ( await checkIfIsRestricted ( urlsFound [ i ] ) || await checkIfIsRestricted ( urlsFound [ i ] + ".gif" ) ) { await restrictedContentEncountered ( message , userId , guildId ) ; } } if ( message . attachments && message . attachments . size > 0 ) { for ( let file of message . attachments ) { if ( file && file . length > 1 && file [ 1 ] . contentType === "image/gif" ) { await restrictedContentEncountered ( message , userId , guildId ) ; } } } } catch ( err ) { try { await recordError ( guildId , userId , err , reason ) ; } catch ( err2 ) { await recordError ( "" , "" , err2 , reason ) ; } } } ) ; }
@description Looks for nitro/steam scams and removes them
 @param {DiscordApi.Client} discord The discord client
@description Looks for nitro / steam scams and removes them @param { DiscordApi . Client } discord The discord client
// ignore posts from bots // ignore posts from mods // possible spam.  Does it have a URL? // see if the message content contains a gif // evaluate the attachments // something went wrong when assessing the message content