From 9ed65bcd74a44c368faccae172bd70f4159d0ef0 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 01:54:39 +0100 Subject: [PATCH 01/26] Update main.py changed the self bot command to be less obvious so you can scrape without getting caught. added a message counter: Scraped x out of y message(s) --- main.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 64ea929..5f73188 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ client = discord.Client() client = commands.Bot( - command_prefix="!", + command_prefix="n", self_bot=True ) client.remove_command('help') @@ -28,7 +28,7 @@ print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me on Github: {Fore.WHITE}https://github.com/lnxcz") print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") -print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}!scrape {Fore.LIGHTBLACK_EX} to log messages\n") +print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}number {Fore.LIGHTBLACK_EX} to log messages\n") def Init(): if config.get('token') == "token-here": @@ -46,8 +46,9 @@ def Init(): @client.command() -async def scrape(ctx, amount: int): +async def umber(ctx, amount: int): f = open(f"scraped/{ctx.message.channel}.txt","w+", encoding="UTF-8") + count = 1 total = amount print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}scraped/{ctx.message.channel}.txt{Fore.LIGHTBLACK_EX}!") async for message in ctx.message.channel.history(limit=amount): @@ -56,14 +57,15 @@ async def scrape(ctx, amount: int): if attachments: realatt = attachments[0] f.write(f"({message.created_at}) {message.author}: {message.content} ({realatt})\n") - print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped message") + print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped {count} out of {total} message(s)") else: f.write(f"({message.created_at}) {message.author}: {message.content}\n") - print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped message") + print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped {count} out of {total} message(s)") except Exception as e: print(f"{Fore.WHITE}[ {Fore.RED}- {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Cannot scrape message from {Fore.WHITE}{message.author}") print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX} {Fore.WHITE}{e}") total = total - 1 + count = count + 1 print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Succesfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") From 01af00921c953c6eb9fb55e6abe07c660e1ab2b3 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 01:55:18 +0100 Subject: [PATCH 02/26] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 0b11609..abc6864 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,6 @@ 4. In channel write `!scrape ` 5. Scraped messages will be saved in `scraped/name-of-channel` -## Settings: -![Settings Showcase](https://camo.githubusercontent.com/91fb91dbef076670a6791ffdea7bcf3591e36643/68747470733a2f2f7768657265732d6d792d74612e636f2f74504a58576c2e706e67) - ## Showcase: ![Showcase](https://i.imgur.com/jQEmM9K.png) From 56b1ab3fe8dc4972c3be41a83d56ba0a0d624c2a Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:00:25 +0100 Subject: [PATCH 03/26] Update main.py --- main.py | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 5f73188..b333998 100644 --- a/main.py +++ b/main.py @@ -24,8 +24,95 @@ token = config.get("token") os.system('cls') -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX} | Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me on Github: {Fore.WHITE}https://github.com/lnxcz") +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.ORANGE}TabbyGarf{Fore.LIGHTBLACK_EX}) +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX} Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow LnX on Github: {Fore.WHITE}https://github.com/lnxcz") +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me there too: {Fore.WHITE}https://github.com/TabbyGarf") + +print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") +print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}number {Fore.LIGHTBLACK_EX} to log messages\n") + +def Init(): + if config.get('token') == "token-here": + os.system('cls') + print(f"\n\n{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You didnt put your token in the config.json file\n\n"+Fore.RESET) + exit() + else: + token = config.get('token') + try: + client.run(token, bot=False, reconnect=True) + os.system(f'Discord message scraper') + except discord.errors.LoginFailure: + print(f"\n\n{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Token is invalid\n\n"+Fore.RESET) + exit() + + +@client.command() +async def umber(ctx, amount: int): + f = open(f"scraped/{ctx.message.channel}.txt","w+", encoding="UTF-8") + count = 1 + total = amount + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}scraped/{ctx.message.channel}.txt{Fore.LIGHTBLACK_EX}!") + async for message in ctx.message.channel.history(limit=amount): + attachments = [attachment.url for attachment in message.attachments if message.attachments] + try: + if attachments: + realatt = attachments[0] + f.write(f"({message.created_at}) {message.author}: {message.content} ({realatt})\n") + print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped {count} out of {total} message(s)") + else: + f.write(f"({message.created_at}) {message.author}: {message.content}\n") + print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped {count} out of {total} message(s)") + except Exception as e: + print(f"{Fore.WHITE}[ {Fore.RED}- {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Cannot scrape message from {Fore.WHITE}{message.author}") + print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX} {Fore.WHITE}{e}") + total = total - 1 + count = count + 1 + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Succesfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") + + +@client.event +async def on_command_error(ctx, error): + error_str = str(error) + error = getattr(error, 'original', error) + if isinstance(error, commands.CommandNotFound): + return + elif isinstance(error, discord.errors.Forbidden): + print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord error: {error}"+Fore.RESET) + else: + print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}{error_str}"+Fore.RESET) + +Init() +from colorama import Fore +import json +import os +import discord + + +from discord.ext import ( + commands, + tasks +) + + + +client = discord.Client() +client = commands.Bot( + command_prefix="n", + self_bot=True +) +client.remove_command('help') + +with open('config.json') as f: + config = json.load(f) + +token = config.get("token") +os.system('cls') + +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.ORANGE}TabbyGarf{Fore.LIGHTBLACK_EX}) +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX} Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow LnX on Github: {Fore.WHITE}https://github.com/lnxcz") +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me there too: {Fore.WHITE}https://github.com/TabbyGarf") print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}number {Fore.LIGHTBLACK_EX} to log messages\n") From 8e2d57377478fc5ce668c154974dacf3d1fbef76 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:03:39 +0100 Subject: [PATCH 04/26] Update README.md --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index abc6864..a4e001f 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,11 @@

📝 Discord Scraper 📝

-

Scrapes messages in chanel

-

⭐ Don't forget to leave a star! ⭐

- -
🔩 V2 Coming soon! 🔩
- +

Scrapes messages in channel or private message.

## Usage: -1. Config settings and token in `config.json` -2. Open install.bat -3. Open start.bat -4. In channel write `!scrape ` -5. Scraped messages will be saved in `scraped/name-of-channel` +1. Config token in `config.json` +2. Open start.bat +3. In channel/DM write `number ` +4. Scraped messages will be saved in `scraped/name-of-channel` ## Showcase: ![Showcase](https://i.imgur.com/jQEmM9K.png) From 936b7ed1aa802b20ab6f5ff7d1fecc63cf38a71f Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:04:11 +0100 Subject: [PATCH 05/26] Update main.py --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index b333998..94cd7cb 100644 --- a/main.py +++ b/main.py @@ -24,7 +24,7 @@ token = config.get("token") os.system('cls') -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.ORANGE}TabbyGarf{Fore.LIGHTBLACK_EX}) +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.YELLOW}TabbyGarf{Fore.LIGHTBLACK_EX}") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX} Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow LnX on Github: {Fore.WHITE}https://github.com/lnxcz") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me there too: {Fore.WHITE}https://github.com/TabbyGarf") From 249c6585658d2df80733ddacb7c7afa33a0246d4 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:37:35 +0100 Subject: [PATCH 06/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4e001f..bc90051 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ 4. Scraped messages will be saved in `scraped/name-of-channel` ## Showcase: -![Showcase](https://i.imgur.com/jQEmM9K.png) +![Showcase](https://ella-nelson.wheres-my-ta.co/5UmnnJAeQ.png) `WARN: Using a selfbot is against TOS, It's not my fault if you get a ban when someone reports you` From 6713d5ee3ff38938170fbf33d9dc027b86e461db Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:38:20 +0100 Subject: [PATCH 07/26] Update main.py --- main.py | 90 +++------------------------------------------------------ 1 file changed, 4 insertions(+), 86 deletions(-) diff --git a/main.py b/main.py index 94cd7cb..2716e00 100644 --- a/main.py +++ b/main.py @@ -25,97 +25,13 @@ os.system('cls') print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.YELLOW}TabbyGarf{Fore.LIGHTBLACK_EX}") -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX} Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow LnX on Github: {Fore.WHITE}https://github.com/lnxcz") -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me there too: {Fore.WHITE}https://github.com/TabbyGarf") - -print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") -print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}number {Fore.LIGHTBLACK_EX} to log messages\n") - -def Init(): - if config.get('token') == "token-here": - os.system('cls') - print(f"\n\n{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You didnt put your token in the config.json file\n\n"+Fore.RESET) - exit() - else: - token = config.get('token') - try: - client.run(token, bot=False, reconnect=True) - os.system(f'Discord message scraper') - except discord.errors.LoginFailure: - print(f"\n\n{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Token is invalid\n\n"+Fore.RESET) - exit() - - -@client.command() -async def umber(ctx, amount: int): - f = open(f"scraped/{ctx.message.channel}.txt","w+", encoding="UTF-8") - count = 1 - total = amount - print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}scraped/{ctx.message.channel}.txt{Fore.LIGHTBLACK_EX}!") - async for message in ctx.message.channel.history(limit=amount): - attachments = [attachment.url for attachment in message.attachments if message.attachments] - try: - if attachments: - realatt = attachments[0] - f.write(f"({message.created_at}) {message.author}: {message.content} ({realatt})\n") - print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped {count} out of {total} message(s)") - else: - f.write(f"({message.created_at}) {message.author}: {message.content}\n") - print(f"{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraped {count} out of {total} message(s)") - except Exception as e: - print(f"{Fore.WHITE}[ {Fore.RED}- {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Cannot scrape message from {Fore.WHITE}{message.author}") - print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX} {Fore.WHITE}{e}") - total = total - 1 - count = count + 1 - print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Succesfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") - - -@client.event -async def on_command_error(ctx, error): - error_str = str(error) - error = getattr(error, 'original', error) - if isinstance(error, commands.CommandNotFound): - return - elif isinstance(error, discord.errors.Forbidden): - print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord error: {error}"+Fore.RESET) - else: - print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}{error_str}"+Fore.RESET) - -Init() -from colorama import Fore -import json -import os -import discord - - -from discord.ext import ( - commands, - tasks -) - - - -client = discord.Client() -client = commands.Bot( - command_prefix="n", - self_bot=True -) -client.remove_command('help') - -with open('config.json') as f: - config = json.load(f) - -token = config.get("token") -os.system('cls') - -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.ORANGE}TabbyGarf{Fore.LIGHTBLACK_EX}) -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX} Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow LnX on Github: {Fore.WHITE}https://github.com/lnxcz") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me there too: {Fore.WHITE}https://github.com/TabbyGarf") print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}number {Fore.LIGHTBLACK_EX} to log messages\n") +os.system("title awaiting command") def Init(): if config.get('token') == "token-here": @@ -152,8 +68,10 @@ async def umber(ctx, amount: int): print(f"{Fore.WHITE}[ {Fore.RED}- {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Cannot scrape message from {Fore.WHITE}{message.author}") print(f"{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX} {Fore.WHITE}{e}") total = total - 1 + os.system("title [{}/{}] scraping {}".format(count,total,ctx.message.channel)) count = count + 1 print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Succesfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") + os.system("title [DONE] - awaiting command".format(total)) @client.event From 477abdfebad4ae6aa955575e93a1ba71873e24db Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:41:51 +0100 Subject: [PATCH 08/26] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index bc90051..d46ebca 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ 2. Open start.bat 3. In channel/DM write `number ` 4. Scraped messages will be saved in `scraped/name-of-channel` +## Differences between original and fork +1. Shows progress in command prompt. (Scraped x out of y message(s)) +2. Shows status in window title (waiting command, amount scraped on channel, done) +3. Stealthier command (number <# of messages) ## Showcase: ![Showcase](https://ella-nelson.wheres-my-ta.co/5UmnnJAeQ.png) From 2f907b979d78556c6101b73301ed647feac61aae Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:42:30 +0100 Subject: [PATCH 09/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d46ebca..59eb4d1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Differences between original and fork 1. Shows progress in command prompt. (Scraped x out of y message(s)) 2. Shows status in window title (waiting command, amount scraped on channel, done) -3. Stealthier command (number <# of messages) +3. Stealth command (`number <# of messages>`) ## Showcase: ![Showcase](https://ella-nelson.wheres-my-ta.co/5UmnnJAeQ.png) From ee9278b5a18a8d749a5b31311119cbbf47d85c24 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:50:35 +0100 Subject: [PATCH 10/26] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 59eb4d1..76f3c59 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@

📝 Discord Scraper 📝

Scrapes messages in channel or private message.

+## Installation: +1. Run `install.bat` or run in cmd `pip install -r _req.txt` +2. Config your token in `config.json` ## Usage: -1. Config token in `config.json` -2. Open start.bat -3. In channel/DM write `number ` -4. Scraped messages will be saved in `scraped/name-of-channel` +1. Open start.bat +2. In channel/DM write `number ` +3. Scraped messages will be saved in `scraped/name-of-channel` ## Differences between original and fork 1. Shows progress in command prompt. (Scraped x out of y message(s)) 2. Shows status in window title (waiting command, amount scraped on channel, done) From 09773f7b0d8a562989c3c5aaa7fdf5568beffcdd Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 03:51:32 +0100 Subject: [PATCH 11/26] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 76f3c59..f9efcc1 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ ## Installation: 1. Run `install.bat` or run in cmd `pip install -r _req.txt` -2. Config your token in `config.json` +2. Config your token, prefix and command in `config.json` ## Usage: 1. Open start.bat 2. In channel/DM write `number ` -3. Scraped messages will be saved in `scraped/name-of-channel` +3. Scraped messages will be saved in `!scrape/name-of-channel` ## Differences between original and fork 1. Shows progress in command prompt. (Scraped x out of y message(s)) 2. Shows status in window title (waiting command, amount scraped on channel, done) -3. Stealth command (`number <# of messages>`) +3. Customizable prefix and command! `default: !scrape` ## Showcase: ![Showcase](https://ella-nelson.wheres-my-ta.co/5UmnnJAeQ.png) From 87e059cb13f76962398afef45304c94be24fc91e Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:04:18 +0100 Subject: [PATCH 12/26] version 2? added customizable prefix and command, output file now has date of scrape (channel-YYYYMMDD-hhmmss) --- main.py | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/main.py b/main.py index 2716e00..d648dae 100644 --- a/main.py +++ b/main.py @@ -2,26 +2,30 @@ import json import os import discord - +from datetime import datetime from discord.ext import ( commands, tasks ) +with open("config.json") as f: + config = json.load(f) + +token = config["token"] +cmd = config["command"] +command_prefix=config["prefix"] + client = discord.Client() client = commands.Bot( - command_prefix="n", + command_prefix=config["prefix"], self_bot=True ) client.remove_command('help') -with open('config.json') as f: - config = json.load(f) - -token = config.get("token") + os.system('cls') print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.YELLOW}TabbyGarf{Fore.LIGHTBLACK_EX}") @@ -30,16 +34,16 @@ print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me there too: {Fore.WHITE}https://github.com/TabbyGarf") print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") -print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}number {Fore.LIGHTBLACK_EX} to log messages\n") +print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}{command_prefix}{cmd} {Fore.LIGHTBLACK_EX} to log messages\n") os.system("title awaiting command") def Init(): - if config.get('token') == "token-here": + if config["token"] == "token-here": os.system('cls') print(f"\n\n{Fore.WHITE}[ {Fore.RED}E {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You didnt put your token in the config.json file\n\n"+Fore.RESET) exit() else: - token = config.get('token') + token = config["token"] try: client.run(token, bot=False, reconnect=True) os.system(f'Discord message scraper') @@ -48,12 +52,14 @@ def Init(): exit() -@client.command() -async def umber(ctx, amount: int): - f = open(f"scraped/{ctx.message.channel}.txt","w+", encoding="UTF-8") +@client.command(name=cmd) +async def scrape(ctx, amount: int): + time = datetime.now() + ft = time.strftime("%Y%m%d-%H%M%S") + f = open(f"scraped/{ctx.message.channel}-{ft}.txt","w+", encoding="UTF-8") count = 1 total = amount - print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}scraped/{ctx.message.channel}.txt{Fore.LIGHTBLACK_EX}!") + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}scraped/{ctx.message.channel}-{ft}.txt{Fore.LIGHTBLACK_EX}!") async for message in ctx.message.channel.history(limit=amount): attachments = [attachment.url for attachment in message.attachments if message.attachments] try: @@ -74,6 +80,7 @@ async def umber(ctx, amount: int): os.system("title [DONE] - awaiting command".format(total)) + @client.event async def on_command_error(ctx, error): error_str = str(error) From 4c0e6a1c36b0921740d1307b442e48cc4b1f77b2 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:05:51 +0100 Subject: [PATCH 13/26] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f9efcc1..a9fac2f 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ 2. Config your token, prefix and command in `config.json` ## Usage: 1. Open start.bat -2. In channel/DM write `number ` -3. Scraped messages will be saved in `!scrape/name-of-channel` +2. In channel/DM write `!scrape ` or the command in your prompt +3. Scraped messages will be saved in `scrape/name-of-channel` ## Differences between original and fork 1. Shows progress in command prompt. (Scraped x out of y message(s)) 2. Shows status in window title (waiting command, amount scraped on channel, done) From 9c53119c65e2f2ac032c39483501eb383e6a4014 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:08:06 +0100 Subject: [PATCH 14/26] Update main.py --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index d648dae..f5cfd86 100644 --- a/main.py +++ b/main.py @@ -28,13 +28,13 @@ os.system('cls') -print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.WHITE}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.YELLOW}TabbyGarf{Fore.LIGHTBLACK_EX}") +print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Discord Chat Scraper made by {Fore.CYAN}LnX{Fore.LIGHTBLACK_EX}, fork by {Fore.YELLOW}TabbyGarf{Fore.LIGHTBLACK_EX}") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Licensed under {Fore.WHITE}MIT {Fore.LIGHTBLACK_EX}License") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow LnX on Github: {Fore.WHITE}https://github.com/lnxcz") print(f"{Fore.WHITE}[ {Fore.CYAN}§ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}You can follow me there too: {Fore.WHITE}https://github.com/TabbyGarf") print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") -print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.WHITE}{command_prefix}{cmd} {Fore.LIGHTBLACK_EX} to log messages\n") +print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.YELLOW}{command_prefix}{Fore.CYAN}{cmd}{Fore.WHITE} {Fore.LIGHTBLACK_EX} to log messages\n") os.system("title awaiting command") def Init(): From 9df1e2cceae83c4667f472e988aed2f6f4e6124d Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:08:27 +0100 Subject: [PATCH 15/26] Add files via upload --- _req.txt | 2 ++ install.bat | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 _req.txt create mode 100644 install.bat diff --git a/_req.txt b/_req.txt new file mode 100644 index 0000000..69e378f --- /dev/null +++ b/_req.txt @@ -0,0 +1,2 @@ +discord +colorama diff --git a/install.bat b/install.bat new file mode 100644 index 0000000..d2441ae --- /dev/null +++ b/install.bat @@ -0,0 +1,5 @@ +@echo off +cls +title installing requirements +pip install -r _req.txt +pause \ No newline at end of file From 1adb2a633a99e75bc2950da700146e5fad412e63 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:09:29 +0100 Subject: [PATCH 16/26] Delete requirements.txt --- requirements.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 69e378f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -discord -colorama From dfb4e16d31cb39b0916613e382ac3cc7d89307cf Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:11:36 +0100 Subject: [PATCH 17/26] fixed grammatical issues --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index f5cfd86..2dbd45c 100644 --- a/main.py +++ b/main.py @@ -76,8 +76,11 @@ async def scrape(ctx, amount: int): total = total - 1 os.system("title [{}/{}] scraping {}".format(count,total,ctx.message.channel)) count = count + 1 - print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Succesfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Successfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") os.system("title [DONE] - awaiting command".format(total)) + print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.YELLOW}{command_prefix}{Fore.CYAN}{cmd}{Fore.WHITE} {Fore.LIGHTBLACK_EX} to log messages\n") + From e7d9803e15386aa9f60122f1789dd27ef39cdbc9 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:12:52 +0100 Subject: [PATCH 18/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9efcc1..c103397 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,6 @@ 3. Customizable prefix and command! `default: !scrape` ## Showcase: -![Showcase](https://ella-nelson.wheres-my-ta.co/5UmnnJAeQ.png) +![Showcase](https://ella-nelson.wheres-my-ta.co/5UmLAQpwz.png) `WARN: Using a selfbot is against TOS, It's not my fault if you get a ban when someone reports you` From ac96e422d29b92bccb01f2b3d6d598244167bda2 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:28:42 +0100 Subject: [PATCH 19/26] Update config.json --- config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.json b/config.json index b9c805e..2a2faf9 100644 --- a/config.json +++ b/config.json @@ -1,3 +1,5 @@ { - "token": "token-here" + "token": "token-here, + "prefix": "!", + "command": "scrape" } From 7c5ab6dff6f6a27797354b954afcb86a668d4d9f Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:28:53 +0100 Subject: [PATCH 20/26] Update config.json --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 2a2faf9..f47ffa2 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "token": "token-here, + "token": "token-here", "prefix": "!", "command": "scrape" } From a25d68585a53b2ec3b2480fda84765f9ca0f3522 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:29:13 +0100 Subject: [PATCH 21/26] Update config.json --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index f47ffa2..21b44c0 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "token": "token-here", + "token": "token-here", "prefix": "!", "command": "scrape" } From faa2e1837cdf5f282fc4d9281688eb06f58917c5 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 8 Feb 2023 20:33:34 +0100 Subject: [PATCH 22/26] v1.1 added "all" parameter now writes file to scraped/Guild/file.txt --- main.py | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 2dbd45c..3f34c02 100644 --- a/main.py +++ b/main.py @@ -35,6 +35,7 @@ print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.YELLOW}{command_prefix}{Fore.CYAN}{cmd}{Fore.WHITE} {Fore.LIGHTBLACK_EX} to log messages\n") +print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.YELLOW}{command_prefix}{Fore.CYAN}{cmd}{Fore.WHITE} all{Fore.LIGHTBLACK_EX} to log every message\n") os.system("title awaiting command") def Init(): @@ -53,14 +54,29 @@ def Init(): @client.command(name=cmd) -async def scrape(ctx, amount: int): +async def scrape(ctx, amount: str): time = datetime.now() ft = time.strftime("%Y%m%d-%H%M%S") - f = open(f"scraped/{ctx.message.channel}-{ft}.txt","w+", encoding="UTF-8") + if (ctx.message.guild != None): + filename = "scraped/{}/{}-{}.txt".format(ctx.message.guild.name,ctx.message.channel,ft) + else: + filename = "scraped/Direct Messages/{}-{}.txt".format(ctx.message.channel,ft) + os.makedirs(os.path.dirname(filename), exist_ok=True) + f = open(filename, "w+", encoding = "UTF-8") + count = 1 - total = amount - print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}scraped/{ctx.message.channel}-{ft}.txt{Fore.LIGHTBLACK_EX}!") - async for message in ctx.message.channel.history(limit=amount): + if amount == "all": + all = True + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Counting the amount of messages, this might take a while...") + os.system("title counting messages...") + amount = len([m async for m in ctx.message.channel.history(limit=None)]) + amount = int(amount) + total = int(amount) + if all == True: + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}all{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}{filename}{Fore.LIGHTBLACK_EX}!") + else: + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}{filename}{Fore.LIGHTBLACK_EX}!") + async for message in ctx.message.channel.history(limit=amount, oldest_first=True): attachments = [attachment.url for attachment in message.attachments if message.attachments] try: if attachments: @@ -76,7 +92,7 @@ async def scrape(ctx, amount: int): total = total - 1 os.system("title [{}/{}] scraping {}".format(count,total,ctx.message.channel)) count = count + 1 - print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Successfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") + print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Succesfully scraped {Fore.WHITE}{total} {Fore.LIGHTBLACK_EX}messages!\n\n{Fore.WHITE}") os.system("title [DONE] - awaiting command".format(total)) print(f"\n{Fore.WHITE}[ {Fore.GREEN}+ {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Bot is ready!") print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Write {Fore.YELLOW}{command_prefix}{Fore.CYAN}{cmd}{Fore.WHITE} {Fore.LIGHTBLACK_EX} to log messages\n") @@ -84,6 +100,7 @@ async def scrape(ctx, amount: int): + @client.event async def on_command_error(ctx, error): error_str = str(error) From 922d79e160fc2c0055f070fb53c0585f8f3ee464 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 8 Feb 2023 20:44:04 +0100 Subject: [PATCH 23/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 56ca139..9abe2b8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 2. Config your token, prefix and command in `config.json` ## Usage: 1. Open start.bat -2. In channel/DM write `!scrape ` or the command in your prompt +2. In channel/DM write `!scrape /all` or the command in your prompt 3. Scraped messages will be saved in `scrape/name-of-channel` ## Differences between original and fork 1. Shows progress in command prompt. (Scraped x out of y message(s)) From a18f05009f497a54a1b65b272de4687e18d0c689 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Wed, 8 Feb 2023 20:44:20 +0100 Subject: [PATCH 24/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9abe2b8..e98ecf9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## Usage: 1. Open start.bat 2. In channel/DM write `!scrape /all` or the command in your prompt -3. Scraped messages will be saved in `scrape/name-of-channel` +3. Scraped messages will be saved in `scrape/Guild Name/name-of-channel` ## Differences between original and fork 1. Shows progress in command prompt. (Scraped x out of y message(s)) 2. Shows status in window title (waiting command, amount scraped on channel, done) From 663e30e68b3c1a2139cea6d11337cf6d1bc737de Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Fri, 24 Mar 2023 19:03:06 +0100 Subject: [PATCH 25/26] Add files via upload --- main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 3f34c02..9512d94 100644 --- a/main.py +++ b/main.py @@ -63,20 +63,24 @@ async def scrape(ctx, amount: str): filename = "scraped/Direct Messages/{}-{}.txt".format(ctx.message.channel,ft) os.makedirs(os.path.dirname(filename), exist_ok=True) f = open(filename, "w+", encoding = "UTF-8") - count = 1 + if amount == "all": all = True print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Counting the amount of messages, this might take a while...") os.system("title counting messages...") amount = len([m async for m in ctx.message.channel.history(limit=None)]) - amount = int(amount) + + else: + all = False + amount = int(amount) total = int(amount) + if all == True: print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}all{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}{filename}{Fore.LIGHTBLACK_EX}!") else: print(f"{Fore.WHITE}[ {Fore.YELLOW}? {Fore.WHITE}] {Fore.LIGHTBLACK_EX}Scraping {Fore.WHITE}{amount}{Fore.LIGHTBLACK_EX} messages to {Fore.WHITE}{filename}{Fore.LIGHTBLACK_EX}!") - async for message in ctx.message.channel.history(limit=amount, oldest_first=True): + async for message in ctx.message.channel.history(limit=amount, oldest_first=False): attachments = [attachment.url for attachment in message.attachments if message.attachments] try: if attachments: From af399562c8932704fbb694ffe258391e4d71fe30 Mon Sep 17 00:00:00 2001 From: TabbyGarf <87911854+TabbyGarf@users.noreply.github.com> Date: Thu, 28 Sep 2023 01:17:16 +0200 Subject: [PATCH 26/26] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e98ecf9..d245ec4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@

📝 Discord Scraper 📝

Scrapes messages in channel or private message.

+

DUE TO DISCORDPY BEING BITCHES AND REMOVING ABILITY TO SELF BOT, THIS SCRAPER DOESNT WORK ANYMORE

+ ## Installation: 1. Run `install.bat` or run in cmd `pip install -r _req.txt` 2. Config your token, prefix and command in `config.json`