Last active
July 11, 2023 11:56
-
-
Save Neodevils/d94593550e5d5dfac4db6feda0f71c2b to your computer and use it in GitHub Desktop.
Creating A Webhook Message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interaction.channel.createWebhook({ | |
name: "minesa", | |
avatar: "https://media.discordapp.net/attachments/861208192121569280/1075861709610299412/106327680.png", | |
reason: "This is needed for now" | |
}).then(webhook => console.log(webhook.url)) | |
const { AttachmentBuilder, ButtonBuilder, ActionRowBuilder } = require("discord.js"); | |
const file = new AttachmentBuilder() | |
.setFile("https://cdn.discordapp.com/attachments/861208192121569280/1026236427622695013/Adobe_Express_20221002_2352210_1.png") | |
.setName("rules.png") | |
.setDescription("ππ»ππΌππ½ππΎππΏ"); | |
const row = new ActionRowBuilder().addComponents( | |
new ButtonBuilder() | |
.setCustomId("Rules") | |
.setLabel("Rules") | |
.setStyle("Secondary") | |
.setEmoji("<:boolean:1026230903602696252>"), | |
new ButtonBuilder() | |
.setCustomId("GetRoles") | |
.setLabel("Get Roles") | |
.setStyle("Secondary") | |
.setEmoji("<:property:1020403537676615700>"), | |
new ButtonBuilder() | |
.setCustomId("GetInfo") | |
.setLabel("Get Info") | |
.setStyle("Secondary") | |
.setEmoji("<:class:1020403610934333611>") | |
); | |
webhook.send({ | |
content: "**Welcome!** π\n\n>>> Hey! This is a server where you can feel mostly free and talk about anything. We have organized channels and bots to keep you entertained. We hope you enjoy your stay here!", | |
components: [row], | |
files: [file] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment