joaocmd / vxTwitterBot

A Discord bot that replaces twitter URLs with vxtwitter for videos and GIFs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vxTwitterBot

A Discord bot that replaces messages that contain https://twitter.com URLs with https://vxtwitter.com (https://github.com/dylanpdx/BetterTwitFix).

Usage

Copy the config-template.json to a config.json and edit as necessary. The config file is structured as follows:

{
    "DISCORD_TOKEN": "<DISCORD_TOKEN_HERE>",
    "TWITTER_BEARER_TOKEN": "<TWITTER_BEARER_TOKEN_HERE>",
    "PREAMBLE": "wrote:\n", // message starts with "@mention wrote:\n"
    "MATCH": "https://twitter.com",
    "REPLACE": "https://vxtwitter.com"
}

The TWITTER_BEARER_TOKEN field can be left with an empty string. In that case, the bot uses the message embed to check if it contains a video. This method does not work for tweets with GIFs and does not always work because the embed might not load or might be loaded only after on_message is called.

Necessary bot permissions

The following permissions are necessary to run the bot:

  • Read Messages/View Channels (Requires message content intent)
  • Send Messages
  • Manage Messages
  • Embed Links

About

A Discord bot that replaces twitter URLs with vxtwitter for videos and GIFs.

License:MIT License


Languages

Language:Python 92.1%Language:Shell 5.4%Language:Dockerfile 2.5%