0% found this document useful (0 votes)
13 views2 pages

Message

The document shows code for a discord bot that sends random memes from an array of image URLs when a command is used. It also creates a button to generate a new random meme when clicked.

Uploaded by

Kids TV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Message

The document shows code for a discord bot that sends random memes from an array of image URLs when a command is used. It also creates a button to generate a new random meme when clicked.

Uploaded by

Kids TV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

require('discord-buttons')(client);

const { MessageButton, MessageActionRow } = require('discord-buttons')


const disbut = require("discord-buttons")
client.on('message', async message => {
if(message.content.startsWith(prefix + "memes")){
var memes = [
"https://images-ext-2.discordapp.net/external/z5Yec6I9KA1-
nknqcvRmTseaR3HoBZzr5ta09PSkUC0/https/i.redd.it/3wiajddpsn271.jpg?
width=581&height=621"
,"https://images-ext-1.discordapp.net/external/
DKyf1S8AFC865m5IwN4Xp19jG4sHOqW7WpIsToha0QE/https/i.redd.it/6g827ztxpag61.jpg?
width=621&height=621"
,"https://images-ext-2.discordapp.net/external/
0BBsOypQ1T44GdN6bc5dHeg0sb8vxYP24qqsezua3vM/https/i.redd.it/27dg8cs9c2661.jpg?
width=620&height=621"
,"https://images-ext-2.discordapp.net/external/8bheXGmkFXGOwuiYAng-dS3mllBkEA_L-
gZsq_5oQ-Y/https/i.redd.it/709yacenst461.jpg"
,"https://images-ext-2.discordapp.net/external/
NtbP0TKB7wsQYK5thV9ZIBcq5plCEA40MKDGcXYV1uU/https/i.redd.it/h78byu164u371.jpg?
width=621&height=621"
,"https://images-ext-2.discordapp.net/external/
ZCRGeSj9S8VIdj81DGMArkFJOGIrusiYVncBsljxtpM/https/i.redd.it/24yzaoymllg71.jpg?
width=637&height=621"
,"https://images-ext-1.discordapp.net/external/
Sd4hvuiOxhwLeAvvpieMiWyeCmy38qk7qmjsFL59wb0/https/i.redd.it/vf8ksffgbcc61.jpg?
width=621&height=621"
,"https://images-ext-2.discordapp.net/external/myjlhHzBVQdaAztDeyytTiMu9iywjp11P8b-
rV_t1rQ/https/i.redd.it/25fp9d4wu7461.jpg?width=516&height=621"
,"https://images-ext-2.discordapp.net/external/sqsFDfBC-
AKjb5wGSzHx4qxGbJF3ZuWvt2uUBRK5QVk/https/i.redd.it/gzzlnmriko761.jpg?
width=621&height=621"
,"https://images-ext-2.discordapp.net/external/B7HoR6W6nF-
pfCuIg8HG3YUgoxhLHSDf5aSXWMMaJUs/https/i.redd.it/rocag83lody61.jpg?
width=349&height=620"
,"https://images-ext-1.discordapp.net/external/
DFQacSj83gnbdFvHVkrNuiwz3ABwtF7iV7e6dSUzm6g/https/i.redd.it/pan46ixztx461.jpg?
width=483&height=621"
,"https://images-ext-1.discordapp.net/external/AmvhrhJIaeSqdkf-
YQoTyAiY4DQZ8KjZFxOnNbwd8lI/https/i.redd.it/9vw6ykgc43861.jpg?width=511&height=621"
,"https://images-ext-1.discordapp.net/external/H04uhCY6L-0RD-sa-
oNFnGRdJB8rKo1ZwlUmU1BiJ28/https/i.redd.it/qp32yy1afpa61.jpg?width=622&height=621"
,"https://images-ext-1.discordapp.net/external/pgSUENT9Zg9HDEl3-
1642zdE_tpF6PS04eGYYEEGxk0/https/i.redd.it/8fi2ch41cts61.jpg?width=601&height=621"
,"https://images-ext-1.discordapp.net/external/Jb4i7wMHzkG2aOC6dLZs17-
Tode4SCCbyJLABmLyXr4/https/i.redd.it/h4j5omekrz161.jpg?width=860&height=621"
,"https://images-ext-2.discordapp.net/external/SK-
poNU5Z7jZ2JU3SlFSievzapfAR2IrxAKd24QSgXs/https/i.redd.it/gx5nykyiubc61.jpg?
width=491&height=621"
,"https://images-ext-1.discordapp.net/external/d-yLZoo9Ik54qRnXJTbe9e90p-
pvL1p5t72VwuFiUDI/https/i.redd.it/aygcpdddqsu61.jpg?width=552&height=621"
,"https://images-ext-2.discordapp.net/external/
xp1PkpevqmzFL4H9xtwkNEUqYht08f9WYMYL68q0Lf4/https/i.redd.it/b24j6y4wn4c61.jpg?
width=621&height=621"
,"https://images-ext-1.discordapp.net/external/z6rLPkPWf-
RuIVJN86RzPeB7yCBCb5eVgl3UaslJ0fY/https/i.redd.it/g92c7dewn0261.jpg?
width=621&height=621"
,"https://images-ext-2.discordapp.net/external/EXlammd9T2jQ6kUWSiqxgXFo-
C1xEo6R7nwwY58fAoE/https/i.redd.it/h93f90jcmhl61.jpg?width=632&height=621"
,"https://images-ext-1.discordapp.net/external/F_MHeqADKGElCljI58QSvuc1ZJjQDnZTA-
SU3lSykUg/https/i.redd.it/qj5kmg8brp861.jpg?width=621&height=621"
,"https://images-ext-2.discordapp.net/external/
ZCRGeSj9S8VIdj81DGMArkFJOGIrusiYVncBsljxtpM/https/i.redd.it/24yzaoymllg71.jpg?
width=637&height=621"
,"https://images-ext-2.discordapp.net/external/
91Z8mgH7Dq2bGHbJ5CdMI8gDoUei3x4HvIp9ezEyKJg/https/i.redd.it/0vae7117km361.jpg?
width=514&height=621"
,"https://images-ext-1.discordapp.net/external/
8aTYa7cwIn6cF3zUMbjDCBnvRGwkcjPmoPnB-Ca07SA/https/i.redd.it/rfq86dg7hpa61.png"
,"https://images-ext-1.discordapp.net/external/
wPtjL5vtKvWLGaWEbgMF9zIe5DRL97a_Cxbm1sm2P9E/https/i.redd.it/1obxcd7bq7g61.jpg?
width=457&height=620"
,"https://images-ext-1.discordapp.net/external/x8X0fSz-
fDbdO23ihfZKTQMmWs6D6Xgj38owXpNQz-w/https/i.redd.it/gplsggudynd61.jpg?
width=621&height=621"]
const button1 = new MessageButton()
.setLabel("‫)"️☕ توليد ميم‬
.setStyle("green")
.setID("gen")
const embed = new Discord.MessageEmbed()
.setTitle("‫)"ميمز‬
.setImage(memes[Math.floor(Math.random() * memes.length)])
.setColor("BLUE")
.setFooter("Arab Developers™")//‫ ممنوع تشيل الحقوق‬.__.
message.channel.send(embed , button1)

client.on('clickButton', async (button) => {


if(button.id === "gen"){
await button.reply.defer()
const embed2 = new Discord.MessageEmbed()
.setTitle("‫)"ميمز‬
.setImage(memes[Math.floor(Math.random() * memes.length)])
.setColor("BLUE")
.setFooter("Arab Developers™")//‫ ممنوع تشيل الحقوق‬.__.
await button.message.edit(embed2 ,button1)
}
})
}
})

You might also like