External Discord feeder for AIL framework. (with a manually created user account)
Warning! Automating user accounts is technically against TOS, so use at your own risk!
It is recommended to use a fresh account for this, since the account might be banned/ phone locked!
Install the Python dependencies:
pip3 install -U -r requirements.txt
This script will install the following Python libraries:
Create a file token.txt
in the etc/
folder. Add the Discord token of the account you want to use.
How to get the Discord user token
Create a file server-invite-codes.txt
in the etc/
folder if you want to automatically join and scan new servers. Add the invite codes in separate lines in this file (Make sure to not add the complete links! e.g., abcd1234 instead of https://discord.gg/abcd1234). This file can also be filled by running the inviteRetriever.py
script. This script will populate the server-invite-codes.txt
file with the codes from a Redis database, with credentials in the config file.
Replace the API key value in the config file with your API key value from AIL and make sure an instance of the ail-framework is running. You can also modify the other fields in the config file.
Join the desired servers. This can be done manually or automatically with some limits.
- For the manual version, just join the desired servers and proceed to step 5.
- For the automatic version, follow these steps:
- Open the Discord client and login or register. You should see the main menu of the Discord app. (Page with DMs etc)
- Run the
feeder.py
script and wait for the first scan to finish. Once the scan is finished, the program will give some options to continue. Choose 'join' to join 20 servers automatically. - The program will attempt to join 20 servers of the
server-invite-codes.txt
file and open the prompts in the Discord app. - Wait for the program to finish and then accept the invites to join the servers.
- Enter 'done' in the console, once you finished accepting the invites, to continue the scan.
- Repeat when the program gives the option to choose again.
Run the command below with the desired parameters and wait for execution to finish.
ail-feeder-discord/: python3 bin/feeder.py --help
usage: feeder.py [-h] [--verbose] [--nocache] [--replies] [--noleave] [--maxsize MAXSIZE] [--scantime SCANTIME]
[--messagelimit MESSAGELIMIT]
query
positional arguments:
query query to search on Discord to feed AIL
optional arguments:
-h, --help show this help message and exit
--verbose verbose output
--nocache disable cache
--replies follow the messages of a thread
--noleave stay on the server after having scanned it
--maxsize MAXSIZE the maximum size of a url in bytes
--scantime SCANTIME the amount of time the application should keep listening for new messages in seconds (turned off by default)
--messagelimit MESSAGELIMIT
maximum number of messages to fetch (multiples of 25) (-1 to get all)
The program does the following in this order:
- Login with the given account (token in
etc/token.txt
) - Fetch all the servers the user is already part of
- Scan the channels in each server for the given query, if a match is found, extract the data and upload it to the AIL framework
- After scanning for the query in the messages, the program looks for URLs in the channels, if a URL is found, extract the data and upload it to the AIL framework
- When the scan is done, the program gives a few choices to continue:
- 'exit' → finish the execution of the program
- 'join' → join 20 servers from the
server-invite-codes.txt
file - 'leave' → leave all the servers the user is on
- 'leave <number>' → leave <number> servers the user is on
- Once 'exit' was passed as an option, the program starts to listen for incoming messages for
scantime
seconds - When a message comes in, matching the query or containing a link, the data is extracted and uploaded
- When the
scantime
seconds are up, the program exits
NB: When a new message arrives during steps 2-5, the program treats the new message first and continues the previous scan after completing the new incoming message.
This feeder uses the PyAIL API to upload to the AIL framework.
The final result that is send to AIL is as follows:
source
is the name of the AIL feeder modulesource-uuid
is the UUID of the feeder (unique per feeder)data
is the base64 encoded value of the gziped datadata-sha256
is the SHA256 value of the uncompress datameta
is the generic field where feeder can add the metadata collected