### Listen to API Events (JavaScript) Source: https://context7.com/koreanbots/js-sdk/llms.txt This snippet shows how to initialize the Koreanbots client and attach event listeners for 'rateLimit', 'timeout', 'request', and 'serverCountUpdated' events. It logs information about each event, providing insights into API interactions and potential issues. The code requires the 'koreanbots' package and environment variables for API token and client ID. ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN, requestTimeout: 30000, retryLimit: 5 }, clientID: process.env.CLIENT_ID }) // Listen for rate limit events koreanbots.api.client.on("rateLimit", (info) => { console.log("Rate limited!") console.log(`Global: ${info.isGlobal}`) console.log(`Path: ${info.path}`) console.log(`Method: ${info.method}`) console.log(`Limit: ${info.limit}`) console.log(`Retry after: ${info.retryAfter}ms`) }) // Listen for timeout events koreanbots.api.client.on("timeout", (info) => { console.log("Request timed out!") console.log(`URL: ${info.url}`) console.log(`Method: ${info.method}`) }) // Listen for all requests (useful for logging) koreanbots.api.client.on("request", (req, res) => { console.log(`Request to: ${req.path}`) console.log(`Status: ${res.statusCode}`) }) // Listen for server count updates koreanbots.api.client.on("serverCountUpdated", (data) => { console.log("Server count updated!") console.log(`New server count: ${data.servers}`) console.log(`Response code: ${data.code}`) }) // Make requests to trigger events koreanbots.bots.fetch("653534001742741552") .then(bot => console.log(`Fetched: ${bot.name}`)) ``` -------------------------------- ### Initialize KoreanbotsClient for Discord.js Integration (JavaScript) Source: https://context7.com/koreanbots/js-sdk/llms.txt Initializes the `KoreanbotsClient`, which extends Discord.js `Client`, for seamless integration with Discord bots. It automatically handles server count updates at specified intervals and initializes the Koreanbots instance upon client readiness. ```javascript const { KoreanbotsClient } = require("koreanbots") const client = new KoreanbotsClient({ intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_MEMBERS"], koreanbots: { api: { token: process.env.KOREANBOTS_TOKEN } }, koreanbotsClient: { updateInterval: 600000, // Update every 10 minutes (default: 30 minutes) updateOnInit: true // Update immediately on ready (default: true) } }) client.on("ready", () => { console.log(`Logged in as ${client.user.tag}`) // client.koreanbots is now available console.log(`Koreanbots client initialized: ${client.koreanbots !== null}`) }) client.login(process.env.DISCORD_TOKEN) process.on("SIGINT", () => { client.destroy() // Cleans up interval and Discord connection process.exit() }) ``` -------------------------------- ### Initialize Standalone Koreanbots Client (JavaScript) Source: https://context7.com/koreanbots/js-sdk/llms.txt Initializes the standalone `Koreanbots` client for direct interaction with the KOREANBOTS API. This includes setting API credentials, request timeouts, retry limits, and configuring cache settings for bots and users. ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ clientID: "123456789012345678", api: { token: process.env.KOREANBOTS_TOKEN, version: 2, // API version (1 or 2) requestTimeout: 30000, // Request timeout in ms retryLimit: 5 // Max retry attempts }, maxSize: 100, // Global cache max size sweepInterval: 10000, // Global cache sweep interval in ms bots: { cache: { maxSize: 150, sweepInterval: 60000 } }, users: { cache: { maxSize: 500, sweepInterval: 1800000 } } }) // Clean up resources when done process.on("SIGINT", () => { koreanbots.destroy() process.exit() }) ``` -------------------------------- ### Fetch Server Information with ServerManager.fetch() - JavaScript Source: https://context7.com/koreanbots/js-sdk/llms.txt Fetches information about a Discord server listed on KOREANBOTS, including member count, boost tier, votes, categories, and associated bots. This function supports caching. It requires the KOREANBOTS_TOKEN and CLIENT_ID environment variables. ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN }, clientID: process.env.CLIENT_ID }) // Fetch server information koreanbots.servers.fetch("653083797763522580") .then(server => { console.log(`Server: ${server.name}`) console.log(`ID: ${server.id}`) console.log(`Members: ${server.members}`) console.log(`Votes: ${server.votes}`) console.log(`Boost Tier: ${server.boostTier}`) console.log(`Description: ${server.desc}`) console.log(`Categories: ${server.category.join(", ")}`) console.log(`State: ${server.state}`) // ok, reported, blocked, unreachable console.log(`Vanity: ${server.vanity}`) console.log(`Invite: ${server.invite.url}`) // Check server flags console.log(`Is Official: ${server.is("OFFICIAL")}`) console.log(`Is Verified: ${server.is("KOREANBOTS_VERIFIED")}`) console.log(`Is Partner: ${server.is("KOREANBOTS_PARTNER")}`) // Server owner if (server.owner) { console.log(`Owner: ${server.owner.tag}`) } // Server admins server.admins.forEach((admin, id) => { if (admin) console.log(`Admin: ${admin.tag}`) }) // Bots in server server.bots.forEach(bot => { console.log(`Bot: ${bot.name}`) }) // Server emojis console.log(`Emoji count: ${server.emojis.length}`) }) .catch(err => console.error(`Failed to fetch server: ${err.message}`)) // Force refresh koreanbots.servers.fetch("653083797763522580", { force: true, cache: true }) .then(server => console.log(`Refreshed: ${server.name}`)) ``` -------------------------------- ### Fetch Bot Information with KOREANBOTS JS SDK Source: https://context7.com/koreanbots/js-sdk/llms.txt Fetches detailed information about a bot from KOREANBOTS. Results are cached by default and can be force-refreshed. Returns a `Bot` instance with properties like name, votes, servers, owners, categories, and status. Requires `koreanbots` package. ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ clientID: process.env.CLIENT_ID, api: { token: process.env.KOREANBOTS_TOKEN } }) // Basic fetch (uses cache if available) koreanbots.bots.fetch("653534001742741552") .then(bot => { console.log(`Bot: ${bot.name}#${bot.discriminator}`) console.log(`Tag: ${bot.tag}`) console.log(`Votes: ${bot.votes}`) console.log(`Servers: ${bot.servers}`) console.log(`Shards: ${bot.shards}`) console.log(`Prefix: ${bot.prefix}`) console.log(`Library: ${bot.lib}`) console.log(`Intro: ${bot.intro}`) console.log(`Categories: ${bot.category.join(", ")}`) console.log(`Status: ${bot.status}`) // online, idle, dnd, streaming, offline console.log(`State: ${bot.state}`) // ok, reported, blocked, private, archived console.log(`Vanity URL: ${bot.vanity}`) console.log(`Website: ${bot.web}`) console.log(`GitHub: ${bot.git}`) console.log(`Discord: ${bot.discord?.url}`) // Check bot flags console.log(`Is Official: ${bot.is("OFFICIAL")}`) console.log(`Is Verified: ${bot.is("KOREANBOTS_VERIFIED")}`) console.log(`Is Partner: ${bot.is("PARTNER")}`) console.log(`Is Premium: ${bot.is("PREMIUM")}`) // Get owners bot.owners.forEach(owner => { console.log(`Owner: ${owner.tag} (${owner.id})`) }) }) .catch(err => console.error(`Failed to fetch bot: ${err.message}`)) // Force refresh (bypass cache) koreanbots.bots.fetch("653534001742741552", { force: true, cache: true }) .then(bot => console.log(`Refreshed ${bot.name} from API and updated cache`)) // Fetch without caching koreanbots.bots.fetch("653534001742741552", { force: true, cache: false }) .then(bot => console.log(`Fetched ${bot.name} without caching`)) ``` -------------------------------- ### Fetch User Information with UserManager.fetch() - JavaScript Source: https://context7.com/koreanbots/js-sdk/llms.txt Fetches detailed information about a KOREANBOTS user, including flags, linked GitHub, owned bots, and servers. This function supports caching. It requires the KOREANBOTS_TOKEN and CLIENT_ID environment variables. ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN }, clientID: process.env.CLIENT_ID }) // Fetch user information koreanbots.users.fetch("285185716240252929") .then(user => { console.log(`User: ${user.tag}`) console.log(`Username: ${user.username}`) console.log(`ID: ${user.id}`) console.log(`Flags: ${user.flags}`) // Check user flags console.log(`Is Administrator: ${user.is("ADMINISTRATOR")}`) console.log(`Is Bug Hunter: ${user.is("BUG_HUNTER")}`) console.log(`Is Bot Reviewer: ${user.is("BOT_REVIEWER")}`) console.log(`Is Premium: ${user.is("PREMIUM_USER")}`) // GitHub info (if linked) if (user.github) { console.log(`GitHub: ${user.github.login}`) } // User's bots console.log(`Number of bots: ${user.bots.size}`) user.bots.forEach((bot, id) => { if (bot) { console.log(`- ${bot.name} (${id})`) } }) }) .catch(err => console.error(`Failed to fetch user: ${err.message}`)) // Force refresh user data koreanbots.users.fetch("285185716240252929", { force: true, cache: true }) .then(user => console.log(`Refreshed user: ${user.tag}`)) ``` -------------------------------- ### BotManager.fetch() - Fetch Bot Information Source: https://context7.com/koreanbots/js-sdk/llms.txt Fetches detailed information about a bot from KOREANBOTS. Results are cached by default and can be force-refreshed. Returns a `Bot` instance with properties like name, votes, servers, owners, categories, and status. ```APIDOC ## GET /bots/{botID} ### Description Fetches detailed information about a specific bot using its ID. This method supports caching and can be configured to bypass the cache for fresh data. ### Method GET ### Endpoint `/bots/{botID}` ### Parameters #### Path Parameters - **botID** (string) - Required - The unique identifier of the bot to fetch. #### Query Parameters - **force** (boolean) - Optional - If true, bypasses the cache and fetches fresh data from the API. - **cache** (boolean) - Optional - If true, stores the fetched data in the cache. Defaults to true. ### Request Example ```javascript // Basic fetch (uses cache if available) koreanbots.bots.fetch("653534001742741552") .then(bot => { console.log(`Bot: ${bot.name}#${bot.discriminator}`) console.log(`Tag: ${bot.tag}`) console.log(`Votes: ${bot.votes}`) console.log(`Servers: ${bot.servers}`) console.log(`Shards: ${bot.shards}`) console.log(`Prefix: ${bot.prefix}`) console.log(`Library: ${bot.lib}`) console.log(`Intro: ${bot.intro}`) console.log(`Categories: ${bot.category.join(", ")}`) console.log(`Status: ${bot.status}`) // online, idle, dnd, streaming, offline console.log(`State: ${bot.state}`) // ok, reported, blocked, private, archived console.log(`Vanity URL: ${bot.vanity}`) console.log(`Website: ${bot.web}`) console.log(`GitHub: ${bot.git}`) console.log(`Discord: ${bot.discord?.url}`) // Check bot flags console.log(`Is Official: ${bot.is("OFFICIAL")}`) console.log(`Is Verified: ${bot.is("KOREANBOTS_VERIFIED")}`) console.log(`Is Partner: ${bot.is("PARTNER")}`) console.log(`Is Premium: ${bot.is("PREMIUM")}`) // Get owners bot.owners.forEach(owner => { console.log(`Owner: ${owner.tag} (${owner.id})`) }) }) .catch(err => console.error(`Failed to fetch bot: ${err.message}`)) // Force refresh (bypass cache) koreanbots.bots.fetch("653534001742741552", { force: true, cache: true }) .then(bot => console.log(`Refreshed ${bot.name} from API and updated cache`)) // Fetch without caching koreanbots.bots.fetch("653534001742741552", { force: true, cache: false }) .then(bot => console.log(`Fetched ${bot.name} without caching`)) ``` ### Response #### Success Response (200) - **name** (string) - The name of the bot. - **discriminator** (string) - The discriminator of the bot. - **tag** (string) - The full tag of the bot (name#discriminator). - **votes** (number) - The total number of votes the bot has received. - **servers** (number) - The number of servers the bot is in. - **shards** (number) - The number of shards the bot is running on. - **prefix** (string) - The prefix of the bot. - **lib** (string) - The library the bot is using. - **intro** (string) - A short introduction or description of the bot. - **category** (array of strings) - A list of categories the bot belongs to. - **status** (string) - The current status of the bot (online, idle, dnd, streaming, offline). - **state** (string) - The current state of the bot on KOREANBOTS (ok, reported, blocked, private, archived). - **vanity** (string) - The vanity URL of the bot, if any. - **web** (string) - The website URL of the bot, if any. - **git** (string) - The GitHub repository URL of the bot, if any. - **discord** (object) - An object containing Discord-related information, potentially with a `url` property. - **owners** (array of objects) - A list of bot owners, each with `tag` and `id` properties. #### Response Example ```json { "id": "653534001742741552", "name": "ExampleBot", "discriminator": "1234", "tag": "ExampleBot#1234", "votes": 1500, "servers": 500, "shards": 4, "prefix": "!", "lib": "discord.js", "intro": "A bot to do things.", "category": ["Fun", "Utility"], "status": "online", "state": "ok", "vanity": null, "web": "https://example.com", "git": "https://github.com/example/bot", "discord": { "url": "https://discord.com/oauth2/authorize?client_id=653534001742741552" }, "owners": [ { "id": "123456789012345678", "tag": "Owner#5678" } ], "flags": [ "OFFICIAL", "KOREANBOTS_VERIFIED" ] } ``` ``` -------------------------------- ### Generate Bot Widgets with WidgetManager Source: https://context7.com/koreanbots/js-sdk/llms.txt The WidgetManager allows generating and fetching widget images for bots, displaying votes, server count, or status. Widgets can be output in various formats (SVG, PNG, JPEG, WebP, AVIF, HEIF) with customizable styles and scaling. It requires a Koreanbots API token and client ID. ```javascript const { Koreanbots } = require("koreanbots") const fs = require("fs") const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN }, clientID: process.env.CLIENT_ID }) const botId = "653534001742741552" // Get widget URLs (no API call needed) console.log(`Votes Widget URL: ${koreanbots.widgets.getVoteWidgetURL(botId)}`) console.log(`Server Widget URL: ${koreanbots.widgets.getServerWidgetURL(botId)}`) console.log(`Status Widget URL: ${koreanbots.widgets.getStatusWidgetURL(botId)}`) // Fetch vote widget as PNG buffer koreanbots.widgets.getVoteWidget(botId, { format: "png", style: "flat", // "classic" or "flat" scale: 1.5, // Scale multiplier icon: true // Show bot icon }) .then(widget => { console.log(`Widget type: ${widget.type}`) // "votes" console.log(`Widget target: ${widget.target}`) // "bots" console.log(`Bot ID: ${widget.id}`) fs.writeFileSync("votes-widget.png", widget.buffer) console.log("Saved votes widget as PNG") }) .catch(err => console.error(`Failed to get vote widget: ${err.message}`)) // Fetch server count widget as SVG koreanbots.widgets.getServerWidget(botId, { format: "svg" }) .then(widget => { fs.writeFileSync("servers-widget.svg", widget.buffer) console.log("Saved server widget as SVG") }) // Fetch status widget as WebP with custom options koreanbots.widgets.getStatusWidget(botId, { format: "webp", style: "classic", scale: 2, icon: false, convertOptions: { quality: 80 } // Sharp conversion options }) .then(widget => { fs.writeFileSync("status-widget.webp", widget.buffer) console.log("Saved status widget as WebP") }) // Refresh a cached widget koreanbots.widgets.getVoteWidget(botId, { format: "png" }) .then(widget => widget.fetch({ format: "png" })) // Re-fetch same widget .then(refreshedWidget => { console.log("Widget refreshed from API") }) ``` -------------------------------- ### API Events - Rate Limit, Timeout, Request Handling Source: https://context7.com/koreanbots/js-sdk/llms.txt The underlying API client emits events for rate limiting, timeouts, and requests that you can listen to for monitoring and debugging purposes. ```APIDOC ## API Events - Rate Limit, Timeout, Request Handling ### Description The underlying API client emits events for rate limiting, timeouts, and requests that you can listen to for monitoring and debugging purposes. ### Method Event Listeners (using `.on()`) ### Endpoint N/A (Client-side events) ### Parameters #### Event: `rateLimit` - **info** (object) - Information about the rate limit event. - **isGlobal** (boolean) - Whether the rate limit is global. - **path** (string) - The API path that was rate limited. - **method** (string) - The HTTP method of the request. - **limit** (number) - The maximum number of requests allowed. - **retryAfter** (number) - The time in milliseconds to wait before retrying. #### Event: `timeout` - **info** (object) - Information about the timeout event. - **url** (string) - The URL of the timed-out request. - **method** (string) - The HTTP method of the request. #### Event: `request` - **req** (object) - The request object. - **path** (string) - The path of the request. - **res** (object) - The response object. - **statusCode** (number) - The HTTP status code of the response. #### Event: `serverCountUpdated` - **data** (object) - Data related to the server count update. - **servers** (number) - The new server count. - **code** (number) - The response code from the server. ### Request Example ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN, requestTimeout: 30000, retryLimit: 5 }, clientID: process.env.CLIENT_ID }) // Listen for rate limit events koreanbots.api.client.on("rateLimit", (info) => { console.log("Rate limited!") console.log(`Global: ${info.isGlobal}`) console.log(`Path: ${info.path}`) console.log(`Method: ${info.method}`) console.log(`Limit: ${info.limit}`) console.log(`Retry after: ${info.retryAfter}ms`) }) // Listen for timeout events koreanbots.api.client.on("timeout", (info) => { console.log("Request timed out!") console.log(`URL: ${info.url}`) console.log(`Method: ${info.method}`) }) // Listen for all requests (useful for logging) koreanbots.api.client.on("request", (req, res) => { console.log(`Request to: ${req.path}`) console.log(`Status: ${res.statusCode}`) }) // Listen for server count updates koreanbots.api.client.on("serverCountUpdated", (data) => { console.log("Server count updated!") console.log(`New server count: ${data.servers}`) console.log(`Response code: ${data.code}`) }) // Make requests to trigger events koreanbots.bots.fetch("653534001742741552") .then(bot => console.log(`Fetched: ${bot.name}`)) ``` ### Response N/A (These are event listeners, not direct responses to requests.) ### Response Example N/A ``` -------------------------------- ### Update Bot Server Count with KOREANBOTS JS SDK Source: https://context7.com/koreanbots/js-sdk/llms.txt Updates your bot's server and shard count on KOREANBOTS. This is essential for keeping your bot's statistics current on the listing. The method skips the API call if the server count hasn't changed (returns code 304). Requires `koreanbots` and `discord.js` packages. ```javascript const { Koreanbots } = require("koreanbots") const Discord = require("discord.js") const client = new Discord.Client({ intents: ["GUILDS"] }) const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN }, clientID: process.env.CLIENT_ID }) async function updateStats() { try { const result = await koreanbots.mybot.update({ servers: client.guilds.cache.size, shards: client.shard?.count ?? 1 }) console.log(`Update response code: ${result.code}`) console.log(`Message: ${result.message}`) console.log(`API Version: ${result.version}`) // Check last update info console.log(`Last guild count: ${koreanbots.mybot.lastGuildCount}`) console.log(`Updated at: ${koreanbots.mybot.updatedAt}`) console.log(`Timestamp: ${koreanbots.mybot.updatedTimestamp}`) } catch (err) { console.error(`Failed to update: ${err.message}`) } } client.on("ready", () => { console.log(`Logged in as ${client.user.tag}`) // Initial update updateStats() // Update every 10 minutes setInterval(updateStats, 600000) }) client.login(process.env.DISCORD_TOKEN) ``` -------------------------------- ### Mybot.update() - Update Server Count Source: https://context7.com/koreanbots/js-sdk/llms.txt Updates your bot's server and shard count on KOREANBOTS. This is essential for keeping your bot's statistics current on the listing. The method skips the API call if the server count hasn't changed (returns code 304). ```APIDOC ## POST /mybot/stats ### Description Updates the server and shard count for your bot on KOREANBOTS. This endpoint is crucial for maintaining accurate statistics on your bot's listing. It includes logic to prevent unnecessary updates if the counts have not changed. ### Method POST ### Endpoint `/mybot/stats` ### Parameters #### Request Body - **servers** (number) - Required - The current number of servers your bot is in. - **shards** (number) - Required - The total number of shards your bot is running on. ### Request Example ```javascript const result = await koreanbots.mybot.update({ servers: client.guilds.cache.size, shards: client.shard?.count ?? 1 }) console.log(`Update response code: ${result.code}`) console.log(`Message: ${result.message}`) console.log(`API Version: ${result.version}`) // Check last update info console.log(`Last guild count: ${koreanbots.mybot.lastGuildCount}`) console.log(`Updated at: ${koreanbots.mybot.updatedAt}`) console.log(`Timestamp: ${koreanbots.mybot.updatedTimestamp}`) ``` ### Response #### Success Response (200) - **code** (number) - The HTTP status code of the response. - **message** (string) - A message indicating the result of the update operation. - **version** (string) - The version of the KOREANBOTS API used for the request. #### Response Example ```json { "code": 200, "message": "Bot stats updated successfully.", "version": "1.0.0" } ``` #### Not Modified Response (304) - **code** (number) - The HTTP status code (304). - **message** (string) - A message indicating that the stats have not changed. #### Response Example ```json { "code": 304, "message": "Bot stats have not changed.", "version": "1.0.0" } ``` ``` -------------------------------- ### Refresh Vote Count with Bot.fetchVotes() and Server.fetchVotes() Source: https://context7.com/koreanbots/js-sdk/llms.txt The `Bot` and `Server` instances offer a `fetchVotes()` method to refresh their vote counts directly from the API. This is useful for obtaining real-time vote data without needing to fetch the entire bot or server object again. The `cache` option determines whether the instance's vote count is updated. ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN }, clientID: process.env.CLIENT_ID }) // Fetch bot and then refresh votes koreanbots.bots.fetch("653534001742741552") .then(async (bot) => { console.log(`Initial votes: ${bot.votes}`) // Refresh votes from API (updates bot.votes if cache: true) const newVotes = await bot.fetchVotes({ cache: true }) console.log(`Updated votes: ${newVotes}`) console.log(`Bot instance votes: ${bot.votes}`) // Same as newVotes when cache: true // Fetch without updating instance const latestVotes = await bot.fetchVotes({ cache: false }) console.log(`Latest votes (not cached): ${latestVotes}`) }) // Same for servers koreanbots.servers.fetch("653083797763522580") .then(async (server) => { console.log(`Initial votes: ${server.votes}`) const newVotes = await server.fetchVotes({ cache: true }) console.log(`Updated votes: ${newVotes}`) }) ``` -------------------------------- ### Check User Vote Status with Mybot.checkVote() - JavaScript Source: https://context7.com/koreanbots/js-sdk/llms.txt Checks if a user has voted for your bot on KOREANBOTS. Vote data is cached for 10 seconds by default. This function returns the vote status and the timestamp of the last vote. It requires the KOREANBOTS_TOKEN and CLIENT_ID environment variables. ```javascript const { Koreanbots } = require("koreanbots") const koreanbots = new Koreanbots({ api: { token: process.env.KOREANBOTS_TOKEN }, clientID: process.env.CLIENT_ID }) // Check if user has voted async function handleVoteCheck(userId, message) { try { const vote = await koreanbots.mybot.checkVote(userId) console.log(`User ${userId} voted: ${vote.voted}`) console.log(`Last vote timestamp: ${vote.lastVote}`) if (vote.voted) { const lastVoteDate = new Date(vote.lastVote) message.channel.send( `Thank you for voting! Your last vote was on ${lastVoteDate.toLocaleString()}` ) } else { message.channel.send( `You haven't voted yet! Vote at https://koreanbots.dev/bots/${koreanbots.mybot.clientID}/vote` ) } } catch (err) { console.error(`Vote check failed: ${err.message}`) } } // Usage in a Discord.js command handler client.on("messageCreate", (message) => { if (message.content === "!checkvote") { handleVoteCheck(message.author.id, message) } }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.