Skip to content

Latest commit

 

History

History
215 lines (154 loc) · 6.52 KB

Documentation.md

File metadata and controls

215 lines (154 loc) · 6.52 KB

API Documentation

What our new API includes/doesn't include:
  • Adding an option for booleans to be implemented so the API returns are simplified
  • Noob-friendly examples
  • Getting each member in a specific guild

All our functions sorted by what they return

Functions that return objects
Object returns Boolean
getGuild
  • Boolean (Don't use if object wanted as a return)
getOwner
  • Boolean (Don't use if object wanted as a return)
getChannelsByType
  • Boolean (Don't use if object wanted as a return)
getAllChannelsByObject
  • Boolean
getAllNSFWChannels
  • Boolean (Don't use if object wanted as a return)
Functions that return Names/IDs
Name / ID returns Boolean
getGuild
  • Boolean (Use if name/id wanted as a return)
getOwner
  • Boolean (Use if name/id wanted as a return)
getChannelsByType
  • Boolean (Use if name/id wanted as a return)
getAllChannelsByName
  • Boolean
getAllChannelsByID
  • Boolean
getAllChannelsWithTimeout
  • Boolean (Use if name/id wanted as a return)
getAllNSFWChannels
  • Boolean (Use if name/id wanted as a return)

How to use API functions (normal ver.)


getGuild()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getGuild("603009265346805760")) //Returns the guild object without the boolean parameter supplied

getOwner()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getOwner("603009265346805760")) //Returns the user object of the owner without the boolean parameter supplied

getChannelsByType()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getChannelsByType("603009265346805760")) //Returns an object of each channel without the boolean parameter supplied

getAllChannelsByObject()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllChannelsByObject("603009265346805760")) //Returns an object of each channel in the guild. Boolean isn't a viable parameter here

getAllChannelsByName()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllChannelsByName("603009265346805760")) //Returns all channels in the guild by their name. Boolean isn't a viable parameter here

getAllChannelsByID

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllChannelsByID("603009265346805760")) //Returns all channels in the guild by their ID. Boolean isn't a viable parameter here

getAllChannelsWithTimeout()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllChannelsWithTimeout("603009265346805760")) //Returns all channels that have a timeout, returns the object of each channel with no boolean parameter supplied

getAllNSFWChannels()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllNSFWChannels("603009265346805760")) //Returns all nsfw channels returns the object of each channel with no boolean parameter supplied

getAllMembersByUserObject()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllMembersByUserObject("603009265346805760"))
 //Returns a user object for each member in the guild

getAllMembersByDisplayName()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllMembersByDisplayName("603009265346805760")) //Returns a map of all members in the guild by their display name

getAllMembersByID()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllMembersByID("603009265346805760")) //Returns a map of all members in the guild by their ID and display name depending on if there was a boolean parameter supplied

getAllMemberRoles()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllMemberRoles("603009265346805760", "575108662457139201")) //Returns a map of all the member's roles by the role names + role ids depending on if there was a boolean parameter supplied

getAllGuildRolesByObject()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllGuildRolesByObject("603009265346805760")) //Returns a map of every role in the guild by it's Role Object

getAllGuildRolesByName()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllGuildRolesByName("603009265346805760")) //Returns a map of all the roles in the guild by their name

getAllGuildRolesByID()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllGuildRolesByID("603009265346805760")) //Returns a map of all the roles in the guild by their ID

getAllGuildRolesByHexColor()

const Discord = require("discord.js");
const client = new Discord.Client();
const { Info } = require("guild-collection-api");

console.log(new Info(client).getAllGuildRolesByHexColor("603009265346805760")) //Returns a map of all the roles in the guild by their name + hex color