#channelcreate
1 messages · Page 1 of 1 (latest)
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
I don't think bots can post to audit log
bot's can't
Yeah...