Skip to content

Awesome-Tofu/MemeFetcher-Discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MemeFetcher-Discord

This is a Discord self-bot that fetches random memes from specified channels and serves them through an Express.js web server and uses discord.js-selfbot-v13 in backend.

Setup

  1. Clone this repository through git clone https://github.com/Awesome-Tofu/MemeFetcher-Discord and cd MemeFetcher-Discord.
  2. Install the necessary dependencies with npm install.
  3. Edit the config.js file in the root directory with the following structure:
module.exports = {
    TOKEN: process.env.TOKEN || "your-discord-token",
    CHANNEL_IDs: ["channel_id1", "channel_id2", "you can add more this way..."]
};

If you dont want to add your TOKEN here, you can add in .env file. I would prefer you to add it in environment.

Replace 'your-discord-token' with your Discord token and 'channel-id-1', 'channel-id-2', 'channel-id-3' with the IDs of the channels you want to fetch memes from.

Config

TOKEN

To get Dicord token, go here

CHANNEL_IDs

To get the ID of a channel in Discord, you can follow these steps:

  1. Enable Developer Mode: Go to your Discord settings, then navigate to the "Advanced" tab. Under the "Advanced" section, toggle on "Developer Mode".
  2. Right-click the Channel: Once Developer Mode is enabled, go back to your Discord server. Right-click on the meme channel whose ID you want to obtain.
  3. Select "Copy ID": After right-clicking on the channel, you should see an option to "Copy ID". Click on it, and the ID of the channel will be copied to your clipboard.
  4. Paste the ID: You can now paste the channel ID wherever you need it, such as in your code or in any other Discord-related context.

Usage

Start the bot with node index.js or npm start. The bot will log into Discord and start the web server.

You can then access the /meme route on localhost:3000 to fetch a random message with a media attachment from the specified channels. You can also specify the type of media you want (image or video) and the channel from which to fetch messages using query parameters:

  • type: Set this to 'image' to fetch an image attachment, or 'video' to fetch a video attachment. If not specified or if set to any other value, a random attachment will be fetched.
  • channel: Set this to the ID of a channel to fetch messages from that channel. If not specified, messages will be fetched from a random channel. Make sure bot is in the server of the channel ID.

For example, to fetch an image from a specific channel, you would use a URL like this: localhost:3000/meme?type=image&channel=channel-id

If no media attachments are found, the server will respond with a 404 error.

Note

It's important to note that you should use channel IDs responsibly and in accordance with Discord's terms of service. Misusing channel IDs or any other Discord-related information can lead to your account being banned.

About

An api to get random meme from discord server's channels

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published