Observed since 20 Oct, 20:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
4chan-bot
4chan bot for automatically replying to or creating threads
A 4chan bot for automatically replying to and creating threads using puppeteer.
4chan has recently been rolling out new antispam rules to some boards rolled out new antispam rules to all boards. These rules require that the user either wait 15 minutes to make their first post, or verify their email (or buy a pass).
There are several possible ways to handle this:
Currently, neither of the latter options are implemented, and the bot will wait for the extended cooldown without any additional configuration required.
Currently, you can either wait the 15 minutes or import/export cookies.
I would recommend exporting the cookies of your bots after you are done, so you can reuse them in future to avoid the 15 minute cooldown, provided they don't get banned.
Get captcha button and waits 60s for the cooldown.Get captcha button again and waits for the captcha to loadGet captcha button and waits 5m for the cooldown.Get captcha button again and waits for the captcha to loadnpm install 4chan-bot
Basic example, without any additional configuration:
import Bot from '4chan-bot';
const bot = new Bot();
(async () => {
const thread = await bot.makeThread('Hello, 4chan!', 'path/to/image.jpg', 'b');
if (thread) {
console.log(`Thread created succesfully! Thread ID: ${thread}`);
} else {
console.log(`Failed to create thread. Fail reason: ${bot.cantPostReason}`);
}
})();
Refer to the API Reference to see configuration options.
All config methods are optional.
constructor(): Initialize a new bot instancesetMaxCloudflareAttempts(maxAttempts: number): Set the maximum number of Cloudflare turnstile solving attempts
setHeadless(headless: boolean): Set whether to run in headless mode
truesetMaxCaptchaAttempts(maxAttempts: number): Set the maximum number of 4chan CAPTCHA solving attempts
setUsername(username: string): Set the username for postssetMemeflag(memeFlagId: string): Set a meme flag for posts
NZ or GYsetProxy(proxy: ProxyOptions): Set a proxy for the bot to use
{ host: string, port: number, username: string, password: string }setId(id: string): Set a unique identifier for the bot instanceasync setCookies(cookies: Cookies[]): sets cookiesreplyToThread(message: string, threadId: number, board: string, imagePath?: string): Reply to an existing thread
board is the abbreviation, such as vt, or poltrue if posting doesn't give an error (note that the reply may still be blackholed due to incorrect captcha or other reason)false if there is an error posting, view the error on the cantPostReason property.
MaxCaptchaAttempts times.makeThread(message: string, imagePath: string, board: string): Create a new thread
board is the abbreviation, such as vt, or polfalse if there is an error posting, view the error on the cantPostReason property.
MaxCaptchaAttempts times.destroyBot(): Destroys the bot / closes the browser
canPost: boolean: whether or not the bot can post
cantPostReason: string: reason for the bot being unable to post (if canPost is false)
isDestroyed: boolean: whether or not destroyBot() has been calledid?: string: the id, set by setId()getCookies(): returns array of cookies
Posting a reply + thread in headful mode
This project is licensed under the MIT License. See the LICENSE file for details.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@types/user-agentsEnvironment{
"local_name": "@types/user-agents",
"alias": false,
"peer_metadata": null
} | 1.0.4 | runtime |
puppeteerEnvironment{
"local_name": "puppeteer",
"alias": false,
"peer_metadata": null
} | 23.6.0 | runtime |
puppeteer-real-browserEnvironment{
"local_name": "puppeteer-real-browser",
"alias": false,
"peer_metadata": null
} | 1.3.16 | runtime |
sharpEnvironment{
"local_name": "sharp",
"alias": false,
"peer_metadata": null
} | 0.33.5 | runtime |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | 5.6.3 | runtime |
user-agentsEnvironment{
"local_name": "user-agents",
"alias": false,
"peer_metadata": null
} | 1.1.329 | runtime |
Source distribution
{
"integrity": "sha512-/oX4vk8QK7Ld0UvBdDfydSuhkXPUQhJIp5QMXhZv6VFdkCAk3VXlyiajmoIsF6/2CDeDEcd6omuh1uWy5NndAw==",
"shasum": "35f723d2ad37fae5331d0a5cad9abe45c76533fe",
"tarball": "https://registry.npmjs.org/4chan-bot/-/4chan-bot-1.0.1.tgz",
"fileCount": 16,
"unpackedSize": 9256787,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQDUDqC2heyIzAZcbbTM0Ptel3KMWGlMa7lQbTb5ZB09WQIgIQlEG1kqKmDbl7s0FwXwh5o4gRNZEPx2BbP7OYGeBpg="
}
]
}Observed since 20 Oct, 20:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:1c0706ec4e7268a2687f04895188bb271e6025a3a17f8f9115ed80bb3caa8567