https://github.com/bgmp/4discord
4chan Discord Bot written in Ruby
https://github.com/bgmp/4discord
4chan discordrb nsfw
Last synced: about 1 year ago
JSON representation
4chan Discord Bot written in Ruby
- Host: GitHub
- URL: https://github.com/bgmp/4discord
- Owner: BGMP
- License: mit
- Created: 2022-10-11T22:47:01.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-25T14:10:27.000Z (about 3 years ago)
- Last Synced: 2025-03-29T13:11:18.714Z (about 1 year ago)
- Topics: 4chan, discordrb, nsfw
- Language: Ruby
- Homepage:
- Size: 671 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.YML
Awesome Lists containing this project
README
4discord
Discord bot which fetches random posts from any 4chan.org board!
### What is 4chan?
From [4chan.org](https://4chan.org)'s landing page:
"4chan is a simple image-based bulletin board where anyone can post comments and share images. There are boards dedicated to a variety of topics, from Japanese animation and culture to videogames, music, and photography. Users do not need to register an account before participating in the community. Feel free to click on a board below that interests you and jump right in!
Be sure to familiarize yourself with the [Rules](https://4chan.org/rules) before posting, and read the [FAQ](https://4chan.org/faq) if you wish to learn more about how to use the site."
### What is 4discord/4cord?
Formerly **4discord**, now just **4cord**. Browse 4chan from the comfort of your Discord server, pull from any of its boards and explore what the anonymous internet has to say using simple slash commands on your text channels of choice.
### Set up
1. Invite **4discord** to your Discord server using
[this invite link](https://discord.com/api/oauth2/authorize?client_id=780529113118539798&permissions=2048&scope=bot)!
2. On your Discord server, you may configure the bot at Server Settings » Integrations.
3. Make sure the channel where you want to use the bot at is marked as **NSFW** (Age Restricted Channel).
4. All set! Now you should be able to use the bot on the channels you have defined.
### Commands
The bot uses slash commands as of its rewrite. Make sure to select the commands you want to execute and then provide
the arguments as Discord requests them via visual queues (use the Tab key to auto-complete).
The following list contains all available commands:
* `/chan [board]`: Pull a random post from a 4chan board. Not providing a board will randomly pull from /o/!
* `/chans [page]`: Display available 4chan boards.
* `/4help`: Display general help for the bot.
### Running
Instructions on how to set the bot up internally, and on how to run it for development/testing purposes.
#### Prerequisites
* [Ruby 2.7.3](https://www.ruby-lang.org/)
* OS X: [RVM](http://rvm.io) is recommended over the default OS X Ruby. Here's a one-liner:
`\curl -sSL https://get.rvm.io | bash -s stable --ruby`
* Ensure bundler is installed: `gem install bundle`
* From the project's root, run `bundle install` to download and install dependencies.
#### Launching
* Create a bot application on your [Discord applications portal](https://discord.com/developers/applications).
* Rename the [config.yml.secrets](https://github.com/BGMP/4discord/blob/master/config/config.yml.secrets) to `config.yml`.
* Complete the fields in `config.yml` with your bot's client id and token.
* Run the [4discord.rb](https://github.com/BGMP/4discord/blob/master/src/4discord.rb) file. (`ruby 4discord.rb`)
### Data Collection
4discord is proud to collect **NO** data. With the migration to slash commands and other features introduced by Discord
over time, there is no longer a need to store server IDs, channel IDs, or channel names like the bot used to do in the
past.
### Background
This bot started as a small, fun project to approach, inspired by another
[4chan bot](https://github.com/Romejanic/4chan-Discord-Bot). In the end I decided to carry on and keep adding
features and fixing bugs, due to the massive support I received from friends and other people who enjoy reading 4chan
content!
As of October, 2022 the bot has been rewritten to support the newly introduced slash commands, and to comply with the
new limitations imposed by Discord such as Message Content being now a privileged intent. The old repository has been
archived and made private. All further development will be conducted in this repository instead.
### Disclaimer
Any contributors to 4discord's codebase are not responsible for anything you may pull from 4chan.org using the 4discord
bot. This bot is provided as a free resource open for anybody to use, therefore it is every server owner's
responsibility to moderate what the bot may pull from the site and post on their text channels.