https://github.com/haveachin/reddit-bot
A discord bot that replaces reddit links with their image or video
https://github.com/haveachin/reddit-bot
discord discord-bot embed gif image link link-preview preview reddit video
Last synced: 5 months ago
JSON representation
A discord bot that replaces reddit links with their image or video
- Host: GitHub
- URL: https://github.com/haveachin/reddit-bot
- Owner: haveachin
- License: mit
- Created: 2020-04-13T11:43:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-27T23:04:46.000Z (over 2 years ago)
- Last Synced: 2024-05-19T00:33:52.361Z (about 2 years ago)
- Topics: discord, discord-bot, embed, gif, image, link, link-preview, preview, reddit, video
- Language: Go
- Homepage:
- Size: 759 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Reddit Bot for Discord
A discord bot that replaces image/gif, text, and video posts with a rich preview
### [Invite the bot](https://discord.com/oauth2/authorize?client_id=699350209888518244&scope=bot&permissions=59456)
## Image Preview

## Video Preview

## Text Preview (1000 Character limit)

## Build
Requires Go 1.21+
`make all` or `CGO_ENABLED=0 go build -ldflags "-s -w" ./cmd/reddit-bot`
## Configuration
See the [default configuration file](configs/config.yml) for more information.
### Post Processing for Videos
The Reddit Bot uses yt-dlp for downloading and processing videos. This allows you to customize the post processing args for your hardware.
#### Intel Hardware Accelleration with VAAPI (i965)
```yml
postProcessingArgs:
- >-
Merger+ffmpeg_i1:
-vaapi_device /dev/dri/renderD128
- >-
Merger+ffmpeg_o:
-vcodec h264_vaapi
-vf 'format=nv12,hwupload,scale_vaapi=iw/2:ih/2'
-qp 28
-fpsmax 24
-c:a libopus
-b:a 64k
```
When using Docker Compose you need to add this:
```docker-compose
version: '3'
services:
reddit-bot:
...
group_add:
# Change this to match your "render" host group id.
# Use: getent group render | cut -d: -f3
- "989"
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
```
#### Nvidia Hardware Accelleration with CUDA
```yml
postProcessingArgs:
- >-
Merger+ffmpeg_i1:
-hwaccel cuda
-hwaccel_output_format cuda
- >-
Merger+ffmpeg_o:
-vf 'hwupload,scale_cuda=iw/2:ih/2'
-c:v h264_nvenc
-rc constqp
-qp 28
-fpsmax 24
-c:a libopus
-b:a 64k
```
Docker setup not done yet. Contributions are welcome.