npm i discordjs-fun
const Discord = require('discord.js')
const client = new Discord.Client({ intents: 513 })
Visit: https://discordjs.guide for discord.js guides.
const { EightBall } = require('discordjs-fun');
client.on('messageCreate', (message) => {
if(message.content === '?8ball') {
new EightBall({
message,
slash: false // Set to true of you use slash command
question: message.content,
embed: {
color: '#11FFEF'
}
}).fire()
}
})
const { googleSearch } = require('discordjs-fun')
client.on('messageCreate', (message) => {
if(message.content === '?google') {
const result = await googleSearch({ query: message.content, api: {
key: "GOOGLE_API_KEY",
cx: "GOOGLE_CX_KEY"
}})
console.log(result);
}
})
const { googleImage } = require('discordjs-fun');
client.on('messageCreate', (message) => {
if(message.content === '?image') {
const result = await googleImage({
message,
slash: false, // Set to true if you use slash_command
query: message.content,
api: {
key: "GOOGLE_API_KEY",
cx: "GOOGLE_CX_KEY"
},
embed: {
color: "RED"
}
})
console.log(result);
}
})
const { owoify } = require('discord.js');
const result = owoify('Hello World!');
console.log(result)
const { flip } = require('discordjs-fun');
client.on('messageCreate', (message) => {
if(message.content === '?flip') {
new EightBall({
message,
slash: false // Set to true of you use slash command
flip_emoji: 'CUSTOM_EMOJI / OTHER EMOJI' // Optional
})
}
})