📅  最后修改于: 2022-03-11 15:02:57.598000             🧑  作者: Mango
const discord = require("discord.js")
const fetch = require("node-fetch")
const client = new discord.client()
const keepAlive= require("./server")
const BOT_TOKEN="ODc3ODAyNzY3NjIyNzM3OTYx.YR37iA.M2fc0_YXg2y5mWwpVMcJnw6bIl0"
function getQuote(){
return fetch("https://zenquotes.io/api/random")
.then (res => {
return res.json()
})
.then (res => {
return data[0]["q"]+"-"+ data[0]["a"]
})
}
const SayHello= ["hi","zd","hello","helou","gamarjoba","salami","hey"]
const encouragments=[
"hello , there",
"á°áááá£",
"ááá£ááá á¯áá¡ , á áááá á®áá ááá",
"hey , á áááá á®áá ",
"á¡ááááá",
"áá,áá"
]
client.on("ready"), () => {
console.log('á¨áááááá á áááá ᪠, ${client.user.tag}')
}
client.on("message",msg => {
if (msg.author.bot) return
if (SayHello.some(word => msg.content.includes(word))){
const encouragments = encouragments[Math.floor(Math.random() * encouragments.length)]
msg.reply(encouragments)
}
client.on("message",msg => {
if (msg.author.bot) return
if(msg.content === "$$inspire"){
getQuote().then(quote =>
msg.channel.send(quote))
}
})
client.on("message", msg => {
if (msg.author.bot) return
if(msg.content === "$$help"){
new discord.embedMessage()
.setColor('red')
.addField('`$$kick`- ááááááá')
.setTitle("**List of Commands**\n")
.addField(" - $$help", "ááá®ááá ááá")
.addField(" - $$info", "ááá¤áá áááªáá á©ááá¡ á¨áá¡áá®áá®áá:grin:")
.addField(' - $$Author' , 'ááá¢áá á')
.addField(" - $$ping", "áááá¬áááá¡ ááá¢á¡")
.addField(' - $$AFk ', 'ááááá Afk-áá')
.addField(" - $$cookie", "á£ááááááá¡ ááááªá®ááá á¡ , ááá ááááááá¡! :cookie: ")
.addField(' - $$invites`','ááá¬áááááá ')
.addField(" - $$8ball", "ááá¡á£á®ááá¡ áá¥áááá¡ áááá®áááá¡ ")
.addField(" - $$inpire","á¨áááááááá")
.setFooter("áááá áááá ááá®ááá ááá?, á°á?") // sets the footer to "You need help, do you?"
.setFooter('ááá¢á á¨áá¥áááááá Error49 -á¡ áááá ')
}
})
client.on("message", msg =>{
if(msg.content === "$$help Admin"){
new discord.embedMessage()
.setTitle("**ááááááá¡ áá á«ááááááá**\n")
.addField(" - say", "ááá¢á¡ ááá¥ááááááá á á᪠áááááá ($$say [ááá¡áá¯á])")
.addField(" - mute", "ááá£áááá¡ , ááá ááááááá¡ ($$mute @username [áááááá])")
.addField(" - $$unmute", "áá®á¡ááá¡ áááá£ááááá¡ ááá áááááá¡ , áᣠáá¡ áááá£áááá£ááá($$unmute @username)")
.addField(" - kick", "áááááá¡ ááá ááááááá¡ á¡áá ááá áááá($$kick @username [áááááá])")
.setColor(0xFF0000)
.setFooter("ááá , áááááá!")
}
})
keepAlive()
const mySecret = process.env['TOKEN']
console.log(mySecret);
client.login(mySecret)
client.login(BOT_TOKEN);