Skip to content

Instantly share code, notes, and snippets.

@Neodevils
Last active July 11, 2023 11:56
Show Gist options
  • Save Neodevils/d94593550e5d5dfac4db6feda0f71c2b to your computer and use it in GitHub Desktop.
Save Neodevils/d94593550e5d5dfac4db6feda0f71c2b to your computer and use it in GitHub Desktop.
Creating A Webhook Message
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