Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Latest commit

 

History

History
138 lines (100 loc) · 5.15 KB

README.md

File metadata and controls

138 lines (100 loc) · 5.15 KB

❗ARCHIVE

will create a new repository for the slash command.

Done: https://github.com/Syrup/kurapika-update/


Kurapika

Discord Bots Discord Bots

Note

Don't forget to do npm install --save before running the bot!!!!

Navigation


Tutorial

Environment Setup

rename .env-example to .env now open .env file and fill in each variable according to the instructional

Bot Configuration

open config.js file now replace YOUR DISCORD ID, YOUR DISCORD ID 2 with your discord id and replace YOUR DISCORD ID 2 your friend discord id and replace prefix with your discord prefix

Run Bot

Run the bot with bash command npm start or node index.js

And Done 🖐️

Features

Send Message as Webhook

this.client.util.webhook(urlWebhook, message, opt)
Name Type Default Description Required
urlWebhook String none Your webhook URL true
message MessageEmbed or String none Can be embed or message true
opt Object none Options false

Example

const { MessageEmbed } = require("discord.js");
let url = "Your Webhook URL"
let embed = new MessageEmbed()
.setTitle("Hello")
.setDescription("World")

let opt = {
  username: "Happy",
  avatar_url: message.author.displayAvatarURL(),
  content: "this is optional"
}

this.client.util.webhook(url, embed, opt)

return Object

getMember

this.client.util.getMember(message, name)
Name Type Default Description Required
message Message none message true
name Snowflake or Username none maybe id or name true

Example

(async () => {
  let member = await this.client.util.getMember(message, "Syrup")
  return member
})()

or

async function user(message, name) {
  const member = await this.client.util.getMember(message, name)
  return member
}

user(message, "Kurapika")

return GuildMember

getChannel

this.client.util.getChannel(guild, channel, caseSensitive, wholeWord)

Example

this.client.util.getChannel(message.guild, "general", true)
Name Type Default Description Required
guild Guild none Guild to check true
channel Snowflake or Channel Name none maybe the channel id or name true
caseSensitive boolean false Makes checking by name case sensitive. false
wholeWord boolean false Makes finding by name match full word only. false

This maybe the same as resolveChannel but I have kept it simple :)

return Channel


Discord Bots