GithubHelp home page GithubHelp logo

lucxjo / reddit-discord-bridge Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 854 KB

A reddit to discord bridge. Currently functions 1-subreddit to 1-webhook

Home Page: https://rdb.ludoviko.ch

License: MIT License

TypeScript 87.06% Dockerfile 11.64% Shell 1.30%
deno discord reddit

reddit-discord-bridge's Introduction

reddit-discord-bridge

A reddit to discord bridge. Currently, you may only have one subreddit per instance.

Motivation

I have been using a reddit bot for a while but it is no longer properly maintained so I decided to create this. The way the bridge works is it polls the Reddit API for new posts and then posts them to a Discord channel using Discord webhooks. I may look at converting this to a bot in the future. Since this has no interface, everything must be done through a config file. You can see a sample config file here.

reddit-discord-bridge's People

Contributors

lucxjo avatar

Watchers

 avatar  avatar

Forkers

andrewc2

reddit-discord-bridge's Issues

Not Posting, logs show "not valid JSON error"

Not sure if something changed on the reddit api, or maybe this is a result of rate-limiting. I've turned off the container for now to see if restarting it in an hour clears it.

Version: 1.0.3
SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON
    at parse (<anonymous>)
    at packageData (deno:ext/fetch/22_body.js:375:16)
    at Response.json (deno:ext/fetch/22_body.js:314:18)
    at async fetchSubredditData (file:///app/src/utils/fetchSubredditData.ts:30:36)

Fix duplicated posts

In certain circumstances, the bridge will post multiple times. This obviously should not happen, each post should only appear once. A fix where the subreddit.json file contains the IDs of the 5 previous posts should fix this.

Crashing when a connection cannot be made to Reddit

Bridge details

Version: 1.0.1
Deno: 1.24.3

Logs:

error: Uncaught (in promise) TypeError: error sending request for url (https://www.reddit.com/r/youngroyals/new.json): connection error: connection reset
	                 ^
	const response = await fetch(
    at async mainFetch (deno:ext/fetch/26_fetch.js:287:14)
    at async fetch (deno:ext/fetch/26_fetch.js:501:9)
    at async fetchSubredditData (file:///app/src/utils/fetchSubredditData.ts:25:19)

Customize Embed

If I wanted to customize the embed it appears that sendToWebhook.ts needs to be updated. What would I need to bind my path to, in order to swap it?

Not posting updates

Bridge isn't posting updates, it may be best to refactor code to figure out what is happening

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.