Skip to content

Commit

Permalink
drop music-player functionality, upstream breaks too often
Browse files Browse the repository at this point in the history
  • Loading branch information
philippgitpush committed Jul 22, 2024
1 parent 905ee49 commit 2088ab1
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 543 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:latest

RUN apt-get update && apt-get install -y ffmpeg --no-install-recommends
RUN apt-get update --no-install-recommends

WORKDIR /usr/app

Expand Down
72 changes: 25 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
> [!NOTE]
> Please note that this bot is not actively maintained. Some services, especially those related to embed fixes, may occasionally go down.
> Please note that this bot is not actively maintained.
> [!IMPORTANT]
> The YouTube / Spotify / SoundCloud resolver `play-dl` seems to keep breaking(?) and plays the wrong songs. You can install `youtube-ext`, `@distube/ytdl-core`, `yt-stream` or `ytdl-core` instead. To do this, remove `play-dl` by running `npm remove play-dl` and then install another resolver with `npm install <resolver-of-choice>` in the `data/` directory. Make sure that you have installed NodeJS for this to work. Then recreate the Docker Compose project with `docker compose up --build --force-recreate --no-cache`.
# Discord Embed Buddy

# Discord-SM
This is a Node.js-based Discord bot that intercepts messages with potentially faulty social media embeds and provides proxy links for the content in response.

This is a Node.js-based Discord bot that plays music from various sources including Spotify, YouTube, and SoundCloud. It also includes features for managing the music queue, supports multiple commands, and handles social media link embeds.
## URL Replacements

## Features
Here's an overview of the URL replacements:

- **Music Playback**: Add, skip, stop, and manage songs in the queue from various sources.
- **Social Media Link Embeds**: Automatically replaces original embeds for social media links with custom embed fixes.
- **Multilanguage Support**: The bot can operate in multiple languages. Currently available languages are English and German.
| Original URL | Replacement URL |
|--------------------|------------------|
| `twitter.com` | `fxtwitter.com` |
| `x.com` | `fixupx.com` |
| `tiktok.com` | `d.tnktok.com` |
| `vm.tiktok.com` | `d.tnktok.com` |
| `reddit.com` | `rxddit.com` |
| `old.reddit.com` | `old.rxddit.com` |
| `instagram.com` | `ddinstagram.com`|

## Docker Setup

Expand All @@ -26,6 +31,17 @@ Ensure you have Docker installed on your system.

1. **Clone this repository**.

1. **Configure your `.env` file**.

Before running the Docker container, make sure you set up the necessary environment variables. Create a `.env` file in the `data` directory with the following content:

```sh
DISCORD_TOKEN=<discord-token>
CLIENT_ID=<bot-client-id>
```

Replace `<discord-token>` and `<bot-client-id>` with your actual Discord bot token and client ID.

2. **Navigate to the project directory** where the Dockerfile and `compose.yml` are located.

3. **Build and start the Docker container** using Docker Compose:
Expand All @@ -37,44 +53,6 @@ Ensure you have Docker installed on your system.
- Build the Docker image as defined in the `Dockerfile`.
- Start the container with the configuration specified in `compose.yml`.

### Configuration

Before running the Docker container, make sure you set up the necessary environment variables. Create a `.env` file in the `data` directory with the following content:

```sh
DISCORD_TOKEN=<discord-token>
CLIENT_ID=<bot-client-id>
```

Replace `<discord-token>` and `<bot-client-id>` with your actual Discord bot token and client ID.

## Commands

Here's an overview of the available commands:
### Slash Commands
| Command | Description | Options |
|--------------|-----------------------------------------------------------------------------|---------------------------------------|
| `/play` | Add a song from Spotify, YouTube, SoundCloud, or similar to the queue. | `song`: Song title or link (required) |
| `/stop` | Clear the queue and kick the bot from the channel. | |
| `/skip` | Skip the current song in the queue. | |
| `/listqueue` | Display a list of the current queue. | |
| `/wrongsong` | Remove the last song requested by you from the queue. | |
| `/song` | Display the current song. | |
| `/language` | Set the bot's language for the entire server. | `lang`: Language choice (required) |

### Text Commands

| Command | Description |
|----------------|--------------------------------------------------|
| `!forcedelete` | Deletes all guild-specific commands for the bot. |
| `!forceupdate` | Updates all guild-specific commands for the bot. |

## Localization

The bot supports multiple languages. Currently available languages are English and German. You can change the bot's language using the `/language` command.
## License

This project is licensed under the MIT License.
8 changes: 0 additions & 8 deletions data/config/guild_data.json

This file was deleted.

71 changes: 0 additions & 71 deletions data/config/messages.json

This file was deleted.

12 changes: 4 additions & 8 deletions data/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
{
"name": "discord-sm",
"version": "1.0.0",
"description": "Discord bot that fixes social media embeds and enables music playback",
"name": "embeds-buddy",
"version": "1.1.0",
"description": "Discord bot that fixes social media embeds",
"main": "src/index.js",
"scripts": {
"start": "node --no-deprecation --env-file=.env src/index.js"
},
"author": "philippgitpush",
"license": "MIT",
"dependencies": {
"@discordjs/opus": "^0.9.0",
"discord-player": "^6.6.8",
"discord.js": "^14.14.1",
"fs": "^0.0.1-security",
"play-dl": "^1.9.7"
"discord.js": "^14.14.1"
}
}
153 changes: 0 additions & 153 deletions data/src/commandRefresh.js

This file was deleted.

3 changes: 1 addition & 2 deletions data/src/discordClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const Client = new Discord.Client({ intents: [
Discord.GatewayIntentBits.Guilds,
Discord.GatewayIntentBits.GuildMessages,
Discord.GatewayIntentBits.MessageContent,
Discord.GatewayIntentBits.GuildMembers ,
Discord.GatewayIntentBits.GuildVoiceStates
Discord.GatewayIntentBits.GuildMembers
] });

const token = process.env.DISCORD_TOKEN;
Expand Down
3 changes: 1 addition & 2 deletions data/src/embedFix.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { getMessage, getGuildLang } = require('./locales');
const Client = require('./discordClient');
const Discord = require('discord.js');

Expand All @@ -8,7 +7,7 @@ Client.on(Discord.Events.MessageCreate, message => {
if (hasMatchingDomain(message.content)) {
const url = replaceDomains(extractURL(message.content));
message.suppressEmbeds(true);
message.reply(getMessage('user.embedfix.output', getGuildLang(message.guild.id), { url }));
message.reply(url);
}
});

Expand Down
7 changes: 2 additions & 5 deletions data/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
require('./discordClient'); // Discord Bot Client
require('./locales'); // Localization / translation
require('./embedFix'); // Soecial media link embed fixes
require('./musicPlayer'); // Music player
require('./commandRefresh'); // Discord commands config
require('./discordClient');
require('./embedFix');
Loading

0 comments on commit 2088ab1

Please sign in to comment.