Skip to content

Discord Bot that automatically parses media links (such as Twitter/X, TikTok, Instagram) so the are "fixed" (content of link can be seen in discord without needing to login or being redirected)

Notifications You must be signed in to change notification settings

BlckHawker/Link-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Many people who use Discord send links from external sites. Though some sites may force the user to log in to see the content, which may just be a few lines of text or a short video. There are "fixer links" such as fixupx and vxtiktok which allows the content to be seen in discord without needing to log in or even click on the link.

It can be annoying to remember all the fixer links, especially since they may not be supported anymore. This bot cuts out the user needing to edit links by sending the "fixed" link whenever someone sends a support list.

Here is a list of all the sites that are supported and the bot will look out for

  • Twitter/X
  • Tiktok
  • Instagram

Demonstration

Video Explaination

Bot example gif

Install

These are steps for develoeprs who want to contribute to the bot. Please send an issue and we'll have a conversasion of your idea and if it fits the purpose of the bot. If/When you have a pr ready, please target the develop branch and not master.

1. Install packages

Use npm i or npm install to add the missing pacakges

The bot has the following depencies

  • discord.js v 14.16.3
  • dotenv v 16.4.5
  • jest v 29.7.0

2. Create .env

  • Duplicate the file example.env and rename the copy .env
  • Add the missing variables
    • DISCORD_TOKEN: the token of the bot
    • CLIENT_ID: the id of the bot

3. Familarize yourself with the command

There are a few scripts defined in package.json to stream line to process. Each can be used by running npm run x with x being the command name.

Name Description
register Register all the slash commands
restart Either restarts all or one server's settings back to the default values
missing-variables If a server is missing a setting, it will be added with the default value

5. Run bot

Use node src\index.js to run the bot

4. Create Unit tests (if applicable)

Unit tests are created to verify the bot is correctly dectecing links. Though they can be used in other causes as well. Please add them in tests folder if your addtional is applicable.

Slash Commands

These are the slash commands that the bot handles

Name Description Notes
/help Gives a brief description of the bot and describes what each slash command works.
/toggle-bot enables/disables the bot. If the bot is disabled, then the bot will not send a message when a target link is sent. value: If true, the bot will be enabled. Otherwise, it will be disabled.
/view-enabled-users View who is able to use the /toggle-bot command
/allow-enable Allows a specific user or role to enable/disable the bot. - Will take the role OR user that will be added. Cannot take both parameters at once.
- This can only be used by the server owner
/disallow-enable Remove a specific user or role from of enabling/disabling the bot. - Will take the role OR user that will be removed. Cannot take both parameters at once.
- This can only be used by the server owner
/view-enabled Tells if the bot is enabled/disabled

Known Issues

  • The instgram fixer (ddinstagram) does not work anymore, and I'm unware of another functional one. If you know of one, please send a pr/issue.

About

Discord Bot that automatically parses media links (such as Twitter/X, TikTok, Instagram) so the are "fixed" (content of link can be seen in discord without needing to login or being redirected)

Resources

Stars

Watchers

Forks

Packages

No packages published