#channelcreate

1 messages · Page 1 of 1 (latest)

main hill
#
const { server_log } = require('../channel.json');

module.exports = (client) => {
    client.on("channelCreate", async (channel) => {
        try 
        {
            guild.fetchAuditLogs()
            .then(audit => console.log(audit.entries.first()))
            .catch(console.error)
           const schannel = await client.channels.fetch(server_log);
           const username = channel.client.id
           const exampleEmbed = {
            color: 0x0099ff,
            title: 'Channel Creation: ',
            author: {
                name: username,
                icon_url: "https://cdn.discordapp.com/attachments/883834437408792607/884116353378836530/discord.jpg",
                url: "https://cdn.discordapp.com/attachments/883834437408792607/884116353378836530/discord.jpg",
            },
            description: channel.name,
            thumbnail: {
                url: "https://cdn.discordapp.com/attachments/883834437408792607/884116353378836530/discord.jpg",
            },
            fields: [
                {
                    name: 'User:',
                    value: "usertag",
                    inline: true,
                },
                {
                    name: 'Attachments:',
                    value: `"${urls}"`,
                    inline: true,
                },
                {
                    name: 'Sent Channel:',
                    value: "sentchannel",
                    inline: true,
                },
                
            ],
            timestamp: new Date(),
            footer: {
                text: username,
                icon_url: "avatar",
            },
        };
        
        
        schannel.send({content: `$message.id}`, embeds: [exampleEmbed] });
       
        } 
        catch (error) 
        {
            console.error({error});
        }
    
      });
    }
#

I want to make it such that when executing the method, it shows who created the channel from audit log

#

@bronze sphinx

bronze sphinx
main hill
bronze sphinx
main hill
#

but I want the audit log to be posted as an embed

#

I mean... let's say all of the logs in audit log to be recorded and then sent as an embed to a channel

#

@bronze sphinx