Git Product home page Git Product logo

sofianbrb / discord-mirror Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 30 KB

This is a program to mirror a channel to another using selfbots using discord.py-self library. Beginner-friendly, open source and available help on Discord. See readme file for all the details... For fast help, please contact me on Disocrd (Bird そ#2911)

Python 100.00%
bot clone discord discordclone discordlogger logger mirror python webhooks discordmirror

discord-mirror's Introduction

discord-mirror

Welcome abroad!

This is a simple discord mirror bot to send back every message from a channel to another one using webhook. It works like this:

1- The selfbot account will listen to messages from a predefined list. When one of them is sent to a channel in the list, 2- It retrieves the message content (Text, embeds, images...) 3- And send them back to specified webhook(s). Because yes, you can have several webhooks for a single channel.

This program is entirely written in python on the main.py file (Has comments if you want to look at it). Data is on the data.json file.

HOW TO USE THE BOT:

1- Install the discord python library for selfbots by using this command: pip install discord.py-self

2- Get the user discord token This can be done by logging into the discord account on the web, entering the developper tools menu by pressing simultaneously Ctrl+Shift+I, going into the "Network" tab, reload the page by clicking on F5 or Ctrl+R, type /api in the "Network" search field, go into "Library" within the results and copy what's next "authorization" in the "headers" section. This is the token of the discord account, which will serve us in this program to retrieve messages. (Source: https://www.androidauthority.com/get-discord-token-3149920/) To add the account token/authorized users, just launch the script and it will ask you for these informations. Or go and modify them in the json file if you want to.

3- Configure the program This can be done in two ways:

    1- This way is the fastest and the most beginner friendly, as the program will add automatically the data in the correct format in data.json (Pretty much no risk of errors). 
    Launch the program, it'll ask for basic data and after that, you can use the commands below...
        Add a webhook to a channel:
            By sending a message in this format `>addwebhook {channelid} {webhookurl} {webhook response url}`, the bot will automatically add the channel to the database. Here's some explanations about the command:
                1- "channelid": the ID of the channel you want to send back messages from. Channel ID can be retrieved by doing a right click on the channel, and click on "Copy Channel ID". (Developper Mode needs to be activated in the settings of Discord, Advanced, Developper mode.)
                2- "webhookurl": the URL of the webhook that will send back the messages from the "channel id" channel. 
                3- "webhook response url": (OPTIONAL) This is meant to send back a response about your command. It's to be sure that everything went well. (Not using the discord account to avoid getting banned by Discord, even if it's unlikely...). NOTE: it can be any webhook url, not specifically the same as webhookurl.

        Remove a channel:
            By sending a message in this format `>removechannel {channelid} {webhookurl} {webhook response url}`. Same arguments as before, no need to explain them.
            NOTE: this is NOT same as >removewebhook. >removechannel will delete an entire channel of the database, including every webhook in it.

        Remove a webhook off of a channel:
            By sending a message in this format `>removewebhook {channelid} {webhookurl} {webhook reponse url}`.
                1- "channelid": the ID of the channel you want to remove a webhook of. 
                2- "webhookurl": the url of the webhook you want to remove of the channelid.
                3- "webhook response url": (OPTIONAL) the webhook that'll send you back the response.

        List the webhooks linked to a channel:
            By sending a message in this format `>listchannels {channelid} {webhook response url}
                1- "channelid": the ID of the channel you want to get linked webhooks from.
                2- "webhook response url": the webhook that'll send back the list. VERY IMPORTANT, without it you won't be able to view the list unless you go into the json file.

        Refresh the channels inside the program (In case it didn't do it before):
            By sending a message in this format `>refresh {webhook response url}
                (Webhook response url is optional, but it lets you know if it did refresh or not.)

        Add a user to the list of authorized users
            By sending a message in this format `>adduser {userid} {webhook response url}
                1- "userid": The ID of the user you want to add to the list
                2- "webhook response url": (OPTIONAL) a webhook you want a response to come from if you want. 
        
        remove a user off of the list of authorized users  
            By sending a message in this format `>removeuser {userid} {webhook response url} (Same arguments as the command above)
            NOTE: anyone with authorizations can add/remove anyone. This is a BASIC program, there is no complex system in there.

    2- Do it manually by modifying the data.json file. 

HOW IS THE DATA.JSON FILE CONSTRUCTED (SEE data_example.json FOR BETTER UNDERSTANDING):

1- STRING "account": has the token of the account that is listening to the messages.
2- OBJECT "channels": has the channels that are being followed.
3- ARRAY "channelid": contains the ID of one channel. The list attached to it contains every webhook that'll send back the messages of this specific channel id. Multiple arrays can be put under the "channels" object.
3- ARRAY "authorized_users": contains the list of the users ID that are being able to use the commands. 

If you need any more informations about this project, you can contact me on Discord Bird そ#2911 for fast response, or github will do it fine too.

ATTENTION: self bots are a violation of discord TOS and can get you account banned for it. In theory, using your account only for listening (Which is what this account does) wouldn't get you account banned, because Discordc can't know it, I still suggest you create a new account to listen to messages.

Don't forget the star if you liked this project 💫

discord-mirror's People

Contributors

sofianbrb avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mahipal956

discord-mirror's Issues

Error

Hello !
I'm trying to run the Discord bot but I keep getting this error. Can you help me ?

07.07 12:18:14 [Bot] Traceback (most recent call last):
07.07 12:18:14 [Bot] File "/./Bot1/main.py", line 218, in
07.07 12:18:14 [Bot] account_token = get_account_token()
07.07 12:18:14 [Bot] File "/./Bot1/main.py", line 60, in get_account_token
07.07 12:18:14 [Bot] with open('data.json', 'r') as f:
07.07 12:18:14 [Bot] FileNotFoundError: [Errno 2] No such file or directory: 'data.json'

Error user discord Token

Hey, i'm trying to run the script but i have a problem with user discord token. The way I get the token is correct, but the bot keeps saying it is wrong. Could u help me?

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.