import { AnswerCollector } from "../src/answerCollector.js";
import { Client } from "../src/client.js";
const client = new Client("account token here");
const target = await client.getUserByName("example123").then((user) => user.id);
const collector = new AnswerCollector(client, target, {
interval: 15000,
limit: 5,
idleTimeout: 120000,
});
collector.collect();
collector.on("collected", (answer) => {
if (answer.answer === "hi") {
collector.destroy();
}
});
collector.on("ended", (reason) => {
console.log(`Collector ended" ${reason}`);
});
Info: For how long the collector should collect (in millieseconds)
End Reason: "timeout"
Info: After what about of time without collecting anything the collector should end (in millieseconds)
End Reason: "idle"
Info: After how many messages the collector should end
End Reason: "limit"
Info: Every how many millieseconds tells/answers should be fetched (defaults to 10000ms)
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String (only accepts male, female, diverse)
Type: Boolean
Type: Number
Type: Number
Type: Number
Type: String
Type: Boolean
Type: Boolean
Type: Boolean
Type: Boolean