dressed
Version:
A sleek, serverless-ready Discord bot framework.
28 lines • 1.02 kB
JavaScript
import { Routes } from "discord-api-types/v10";
import { callDiscord } from "../utils/call-discord.js";
/**
* Get a list of users that voted for this specific answer.
* @param channel The channel to get the message from
* @param message The message to get the poll from
* @param answer The answer to get the voters from
* @param options Optional parameters for the request
*/
export async function listAnswerVoters(channel, message, answer, options) {
const res = await callDiscord(Routes.pollAnswerVoters(channel, message, answer), {
method: "GET",
params: options,
});
return res.json();
}
/**
* Immediately ends the poll. You cannot end polls from other users.
* @param channel The channel to get the message from
* @param message The message containing the poll
*/
export async function endPoll(channel, message) {
const res = await callDiscord(Routes.expirePoll(channel, message), {
method: "POST",
});
return res.json();
}
//# sourceMappingURL=polls.js.map