-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create CLI; Create flooding functions
- Loading branch information
Showing
6 changed files
with
153 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
telethon = "*" | ||
python-dotenv = "*" | ||
tqdm = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.9" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# telegram-flood-bot | ||
# Teleflood 🎉 | ||
|
||
Telegram flood bot inspired by the similar one for WhatsApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
AUTH_TYPE=simple | ||
API_ID=133722 | ||
API_HASH=8aspduiowayoy8awoywgdausdowa | ||
PHONE_NUMBER=+18005553535 | ||
PASSWORD=keyboardcat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python | ||
import argparse | ||
import asyncio | ||
from tqdm import tqdm | ||
from dotenv import dotenv_values | ||
from telethon.sync import TelegramClient | ||
from telethon import types | ||
|
||
parser = argparse.ArgumentParser(description="Teleflood - Telegram Flood Bot") | ||
parser.add_argument('--config-file', type=str, default="config.txt", | ||
required=False, help="file with config for the bot in format described on https://github.com/D3rise/teleflood/INSTRUCTIONS.md") | ||
parser.add_argument('--message-count', type=int, default=1000, | ||
required=False, help="count of messages to send") | ||
parser.add_argument('--victim-id', type=str, required=True, | ||
help="a user id to whom the messages will be sent, can be a phone number, username but not actual ID (if you have not yet flooded this victim)") | ||
parser.add_argument('--message', type=str, | ||
required=True, help="a message that will be sent to victim") | ||
|
||
# Parse args and read the credentials file to log bot in with | ||
args = parser.parse_args() | ||
credentials = dotenv_values(args.credentials_file) | ||
loop = asyncio.get_event_loop() | ||
client = TelegramClient( | ||
'teleflood', credentials["API_ID"], credentials["API_HASH"]) | ||
|
||
|
||
async def main(): | ||
# TODO: add multiple flood account support | ||
await client.start(credentials["PHONE_NUMBER"], credentials["PASSWORD"]) | ||
victim = await client.get_entity(args.victim_id) | ||
|
||
# A subfunction that actually sends flood messages to a victim | ||
async def start_flood(message_count: int): | ||
for i in tqdm(range(message_count), desc="Flooding", unit="messages"): | ||
await client.send_message(victim, args.message) | ||
|
||
if isinstance(victim, types.User): | ||
flood_prompt = input( | ||
f"Found account with username {victim.username} and id {victim.id}. Start flooding with {args.message_count} messages? Y/n: ").lower() | ||
if flood_prompt == "" or flood_prompt == "y": | ||
await start_flood(args.message_count) | ||
print( | ||
f"Sent {args.message_count} messages with content \"{args.message}\" to user/bot with username {victim.username}") | ||
else: | ||
print("Aborted.") | ||
|
||
loop.run_until_complete(main()) |