import random
import requests
import telebot
from telebot import types
import time
import re
import json
import os
from datetime import datetime
import threading
import aiohttp
import asyncio
# Configuration
BOT_TOKEN = "YOUR_TELEGRAM_BOT_TOKEN"
ADMIN_IDS = [123456789] # Add your Telegram user ID here
CHECKER_API_KEY = "YOUR_CHECKER_API_KEY" # Add your checker API key
ALLOWED_USERS = set() # Store allowed user IDs
MAX_CARDS_PER_REQUEST = 25
COOLDOWN_TIME = 60 # seconds
user_last_request = {}
bot = telebot.TeleBot(BOT_TOKEN)
# Create data directories if they don't exist
if not os.path.exists('data'):
os.makedirs('data')
# Load allowed users from file
def load_allowed_users():
global ALLOWED_USERS
try:
if os.path.exists('data/allowed_users.json'):
with open('data/allowed_users.json', 'r') as f:
ALLOWED_USERS = set(json.load(f))
except Exception as e:
print(f"Error loading allowed users: {e}")
ALLOWED_USERS = set()
# Save allowed users to file
def save_allowed_users():
try:
with open('data/allowed_users.json', 'w') as f:
json.dump(list(ALLOWED_USERS), f)
except Exception as e:
print(f"Error saving allowed users: {e}")
# Load banned BINs from file
def load_banned_bins():
try:
if os.path.exists('data/banned_bins.txt'):
with open('data/banned_bins.txt', 'r') as f:
return [line.strip() for line in f.readlines()]
return []
except Exception as e:
print(f"Error loading banned bins: {e}")
return []
# Save usage statistics
def log_usage(user_id, command, bin_number=None):
try:
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
log_entry = {
"timestamp": timestamp,
"user_id": user_id,
"command": command,
"bin": bin_number
}
with open('data/usage_log.json', 'a+') as f:
f.seek(0, os.SEEK_END)
if f.tell() == 0:
json.dump([log_entry], f)
else:
f.seek(0)
data = json.load(f)
data.append(log_entry)
f.seek(0)
f.truncate()
json.dump(data, f)
except Exception as e:
print(f"Error logging usage: {e}")
# Check if user is authorized
def is_authorized(user_id):
return user_id in ALLOWED_USERS or user_id in ADMIN_IDS
# Check if user is admin
def is_admin(user_id):
return user_id in ADMIN_IDS
# Check if BIN is banned
def is_banned_bin(bin_number):
banned_bins = load_banned_bins()
return bin_number in banned_bins
# Check rate limiting
def check_rate_limit(user_id):
current_time = time.time()
if user_id in user_last_request:
time_passed = current_time - user_last_request[user_id]
if time_passed < COOLDOWN_TIME:
return False, int(COOLDOWN_TIME - time_passed)
user_last_request[user_id] = current_time
return True, 0
# Validate BIN number
def is_valid_bin(bin_number):
if not bin_number.isdigit():
return False
if len(bin_number) < 6:
return False
return True
# Get BIN information
async def get_bin_info_async(bin_number):
try:
async with aiohttp.ClientSession() as session:
async with session.get(f"https://lookup.binlist.net/{bin_number}",
headers={"Accept-Version": "3"}) as response:
if response.status == 200:
return await response.json()
# Fallback to secondary BIN service
async with aiohttp.ClientSession() as session:
async with session.get(f"https://bins.antipublic.cc/bins/{bin_number}") as response:
if response.status == 200:
return await response.json()
return None
except:
return None
def get_bin_info(bin_number):
return asyncio.run(get_bin_info_async(bin_number))
# Generate card number with Luhn algorithm
def generate_card(bin_prefix, length=16):
card_number = bin_prefix
while len(card_number) < length - 1:
card_number += str(random.randint(0, 9))
# Luhn algorithm to calculate check digit
digits = [int(d) for d in card_number]
odd_digits = digits[-1::-2]
even_digits = digits[-2::-2]
total = sum(odd_digits)
for d in even_digits:
total += sum(divmod(d * 2, 10))
check_digit = (10 - (total % 10)) % 10
return card_number + str(check_digit)
# Generate random card details
def generate_card_details(custom_month=None, custom_year=None):
if custom_month:
month = str(custom_month).zfill(2)
else:
month = str(random.randint(1, 12)).zfill(2)
current_year = int(time.strftime("%y"))
if custom_year:
year = str(custom_year)
if len(year) == 4:
year = year[2:]
else:
year = str(random.randint(current_year + 1, current_year + 5))
cvv = str(random.randint(100, 999))
return month, year, cvv
# Check cards against external API (hypothetical implementation)
async def check_card_validity(card_data):
try:
card_number, month, year, cvv = card_data.split('|')
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.example.com/check-card",
json={
"card_number": card_number,
"month": month,
"year": year,
"cvv": cvv,
"api_key": CHECKER_API_KEY
}
) as response:
if response.status == 200:
result = await response.json()
return result.get("status", "unknown")
return "error"
except Exception:
return "error"
# Start command handler
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
user_id = message.from_user.id
welcome_text = (
"Welcome to CC Generator Bot!\n\n"
"Commands:\n"
"/gen BIN - Generate credit cards with the specified BIN\n"
"/genx BIN AMOUNT - Generate custom amount of cards\n"
"/bininfo BIN - Get detailed information about a BIN\n"
"/settings - Configure your generator settings\n"
"/help - Show this help message\n\n"
"Examples:\n"
"/gen 446542\n"
"/genx 446542 30\n"
"/bininfo 446542\n\n"
)
if not is_authorized(user_id):
welcome_text += (
"
You are not authorized to use this bot.\n"
"Please contact the administrator to request access."
)
if is_admin(user_id):
welcome_text += (
"\nAdmin Commands:\n"
"/adduser USER_ID - Add user to allowed list\n"
"/deluser USER_ID - Remove user from allowed list\n"
"/banbin BIN - Add BIN to banned list\n"
"/unbanbin BIN - Remove BIN from banned list\n"
"/stats - View bot usage statistics\n"
"/broadcast MESSAGE - Send message to all users\n"
)
bot.reply_to(message, welcome_text)
log_usage(user_id, 'start')
# Generate cards command
@bot.message_handler(func=lambda message: message.text.startswith(('/gen', '.gen')))
def generate_cards(message):
user_id = message.from_user.id
if not is_authorized(user_id):
bot.reply_to(message, "
You are not authorized to use this bot. Please contact the administrator.")
return
# Rate limiting
allowed, wait_time = check_rate_limit(user_id)
if not allowed:
bot.reply_to(message, f"
Rate limit exceeded. Please try again in {wait_time} seconds.")
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /gen 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
if is_banned_bin(bin_number):
bot.reply_to(message, "
This BIN is banned from generation.")
return
# Send typing indication
bot.send_chat_action(message.chat.id, 'typing')
# Get BIN info
bin_info = get_bin_info(bin_number)
# Format BIN info text
bin_info_text = "
BIN not found in database."
if bin_info:
bin_info_text = "
BIN Information:\n"
bin_info_text += f"• Brand: {bin_info.get('scheme', bin_info.get('brand', 'Unknown')).title()}\n"
bin_info_text += f"• Type: {bin_info.get('type', 'Unknown').title()}\n"
bin_info_text += f"• Level: {bin_info.get('level', 'Unknown').title()}\n"
if 'bank' in bin_info:
bank_name = bin_info['bank'].get('name', 'Unknown')
bin_info_text += f"• Bank: {bank_name}\n"
if 'country' in bin_info:
country_name = bin_info['country'].get('name', 'Unknown')
country_emoji = bin_info['country'].get('emoji', '')
bin_info_text += f"• Country: {country_name} {country_emoji}\n"
# Generate cards
cards = []
amount = 15 # Default amount
for _ in range(amount):
card_number = generate_card(bin_number)
month, year, cvv = generate_card_details()
cards.append(f"{card_number}|{month}|{year}|{cvv}")
# Format response message
message_text = f"""••• CC GENERATOR
•Format Used: {bin_number}|MM|YY|CVV
{bin_info_text}
Generated Cards:
"""
message_text += "\n".join(cards)
bot.reply_to(message, message_text)
log_usage(user_id, 'gen', bin_number)
# Generate custom amount of cards command
@bot.message_handler(func=lambda message: message.text.startswith(('/genx', '.genx')))
def generate_custom_cards(message):
user_id = message.from_user.id
if not is_authorized(user_id):
bot.reply_to(message, "
You are not authorized to use this bot. Please contact the administrator.")
return
# Rate limiting
allowed, wait_time = check_rate_limit(user_id)
if not allowed:
bot.reply_to(message, f"
Rate limit exceeded. Please try again in {wait_time} seconds.")
return
command_parts = message.text.split()
if len(command_parts) < 3:
bot.reply_to(message, "Please provide a BIN number and amount. Example: /genx 446542 30")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
if is_banned_bin(bin_number):
bot.reply_to(message, "
This BIN is banned from generation.")
return
try:
amount = int(command_parts[2])
if amount > MAX_CARDS_PER_REQUEST:
bot.reply_to(message, f"
Maximum {MAX_CARDS_PER_REQUEST} cards can be generated per request.")
return
except ValueError:
bot.reply_to(message, "Invalid amount. Please provide a valid number.")
return
# Send typing indication
bot.send_chat_action(message.chat.id, 'typing')
# Get BIN info
bin_info = get_bin_info(bin_number)
# Format BIN info text
bin_info_text = "
BIN not found in database."
if bin_info:
bin_info_text = "
BIN Information:\n"
bin_info_text += f"• Brand: {bin_info.get('scheme', bin_info.get('brand', 'Unknown')).title()}\n"
bin_info_text += f"• Type: {bin_info.get('type', 'Unknown').title()}\n"
bin_info_text += f"• Level: {bin_info.get('level', 'Unknown').title()}\n"
if 'bank' in bin_info:
bank_name = bin_info['bank'].get('name', 'Unknown')
bin_info_text += f"• Bank: {bank_name}\n"
if 'country' in bin_info:
country_name = bin_info['country'].get('name', 'Unknown')
country_emoji = bin_info['country'].get('emoji', '')
bin_info_text += f"• Country: {country_name} {country_emoji}\n"
# Generate cards
cards = []
for _ in range(amount):
card_number = generate_card(bin_number)
month, year, cvv = generate_card_details()
cards.append(f"{card_number}|{month}|{year}|{cvv}")
# Format response message
message_text = f"""••• CC GENERATOR
•Format Used: {bin_number}|MM|YY|CVV
{bin_info_text}
Generated Cards:
"""
message_text += "\n".join(cards)
bot.reply_to(message, message_text)
log_usage(user_id, 'genx', bin_number)
# Get BIN info command
@bot.message_handler(func=lambda message: message.text.startswith(('/bininfo', '.bininfo')))
def get_bin_info_command(message):
user_id = message.from_user.id
if not is_authorized(user_id):
bot.reply_to(message, "
You are not authorized to use this bot. Please contact the administrator.")
return
# Rate limiting
allowed, wait_time = check_rate_limit(user_id)
if not allowed:
bot.reply_to(message, f"
Rate limit exceeded. Please try again in {wait_time} seconds.")
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /bininfo 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
# Send typing indication
bot.send_chat_action(message.chat.id, 'typing')
# Get BIN info
bin_info = get_bin_info(bin_number)
# Format BIN info text
bin_info_text = "
BIN not found in database."
if bin_info:
bin_info_text = "
BIN Information:\n"
bin_info_text += f"• Brand: {bin_info.get('scheme', bin_info.get('brand', 'Unknown')).title()}\n"
bin_info_text += f"• Type: {bin_info.get('type', 'Unknown').title()}\n"
bin_info_text += f"• Level: {bin_info.get('level', 'Unknown').title()}\n"
if 'bank' in bin_info:
bank_name = bin_info['bank'].get('name', 'Unknown')
bin_info_text += f"• Bank: {bank_name}\n"
if 'country' in bin_info:
country_name = bin_info['country'].get('name', 'Unknown')
country_emoji = bin_info['country'].get('emoji', '')
bin_info_text += f"• Country: {country_name} {country_emoji}\n"
bot.reply_to(message, bin_info_text)
log_usage(user_id, 'bininfo', bin_number)
# Admin command to add user to allowed list
@bot.message_handler(func=lambda message: message.text.startswith(('/adduser', '.adduser')))
def add_user(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
You are not authorized to use this command.")
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a user ID. Example: /adduser 123456789")
return
try:
new_user_id = int(command_parts[1])
except ValueError:
bot.reply_to(message, "Invalid user ID. Please provide a valid number.")
return
ALLOWED_USERS.add(new_user_id)
save_allowed_users()
bot.reply_to(message, f"User {new_user_id} has been added to the allowed list.")
log_usage(user_id, 'adduser')
# Admin command to remove user from allowed list
@bot.message_handler(func=lambda message: message.text.startswith(('/deluser', '.deluser')))
def remove_user(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
You are not authorized to use this command.")
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a user ID. Example: /deluser 123456789")
return
try:
user_id_to_remove = int(command_parts[1])
except ValueError:
bot.reply_to(message, "Invalid user ID. Please provide a valid number.")
return
if user_id_to_remove in ALLOWED_USERS:
ALLOWED_USERS.remove(user_id_to_remove)
save_allowed_users()
bot.reply_to(message, f"User {user_id_to_remove} has been removed from the allowed list.")
else:
bot.reply_to(message, f"User {user_id_to_remove} is not in the allowed list.")
log_usage(user_id, 'deluser')
# Admin command to ban a BIN
@bot.message_handler(func=lambda message: message.text.startswith(('/banbin', '.banbin')))
def ban_bin(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
You are not authorized to use this command.")
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /banbin 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
banned_bins = load_banned_bins()
if bin_number not in banned_bins:
with open('data/banned_bins.txt', 'a') as f:
f.write(f"{bin_number}\n")
bot.reply_to(message, f"BIN {bin_number} has been banned.")
else:
bot.reply_to(message, f"BIN {bin_number} is already banned.")
log_usage(user_id, 'banbin', bin_number)
# Admin command to unban a BIN
@bot.message_handler(func=lambda message: message.text.startswith(('/unbanbin', '.unbanbin')))
def unban_bin(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
You are not authorized to use this command.")
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /unbanbin 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
banned_bins = load_banned_bins()
if bin_number in banned_bins:
banned_bins.remove(bin_number)
with open('data/banned_bins.txt', 'w') as f:
f.write("\n".join(banned_bins))
bot.reply_to(message, f"BIN {bin_number} has been unbanned.")
else:
bot.reply_to(message, f"BIN {bin_number} is not banned.")
log_usage(user_id, 'unbanbin', bin_number)
# Admin command to view bot usage statistics
@bot.message_handler(func=lambda message: message.text.startswith(('/stats', '.stats')))
def view_stats(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
You are not authorized to use this command.")
return
try:
with open('data/usage_log.json', 'r') as f:
usage_data = json.load(f)
stats_text = "Bot Usage Statistics:\n"
stats_text += f"Total Commands: {len(usage_data)}\n"
command_counts = {}
for entry in usage_data:
command = entry['command']
if command in command_counts:
command_counts[command] += 1
else:
command_counts[command] = 1
for command, count in command_counts.items():
stats_text += f"• {command.capitalize()}: {count}\n"
bot.reply_to(message, stats_text)
except Exception as e:
bot.reply_to(message, f"Error retrieving statistics: {e}")
log_usage(user_id, 'stats')
# Admin command to broadcast a message to all users
@bot.message_handler(func=lambda message: message.text.startswith(('/broadcast', '.broadcast')))
def broadcast_message(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
You are not authorized to use this command.")
return
command_parts = message.text.split(maxsplit=1)
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a message to broadcast. Example: /broadcast Hello everyone!")
return
broadcast_text = command_parts[1]
for allowed_user_id in ALLOWED_USERS:
bot.send_message(allowed_user_id, broadcast_text)
bot.reply_to(message, "Broadcast sent to all users.")
log_usage(user_id, 'broadcast')
# Start the bot
load_allowed_users()
bot.polling()
import requests
import telebot
from telebot import types
import time
import re
import json
import os
from datetime import datetime
import threading
import aiohttp
import asyncio
# Configuration
BOT_TOKEN = "YOUR_TELEGRAM_BOT_TOKEN"
ADMIN_IDS = [123456789] # Add your Telegram user ID here
CHECKER_API_KEY = "YOUR_CHECKER_API_KEY" # Add your checker API key
ALLOWED_USERS = set() # Store allowed user IDs
MAX_CARDS_PER_REQUEST = 25
COOLDOWN_TIME = 60 # seconds
user_last_request = {}
bot = telebot.TeleBot(BOT_TOKEN)
# Create data directories if they don't exist
if not os.path.exists('data'):
os.makedirs('data')
# Load allowed users from file
def load_allowed_users():
global ALLOWED_USERS
try:
if os.path.exists('data/allowed_users.json'):
with open('data/allowed_users.json', 'r') as f:
ALLOWED_USERS = set(json.load(f))
except Exception as e:
print(f"Error loading allowed users: {e}")
ALLOWED_USERS = set()
# Save allowed users to file
def save_allowed_users():
try:
with open('data/allowed_users.json', 'w') as f:
json.dump(list(ALLOWED_USERS), f)
except Exception as e:
print(f"Error saving allowed users: {e}")
# Load banned BINs from file
def load_banned_bins():
try:
if os.path.exists('data/banned_bins.txt'):
with open('data/banned_bins.txt', 'r') as f:
return [line.strip() for line in f.readlines()]
return []
except Exception as e:
print(f"Error loading banned bins: {e}")
return []
# Save usage statistics
def log_usage(user_id, command, bin_number=None):
try:
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
log_entry = {
"timestamp": timestamp,
"user_id": user_id,
"command": command,
"bin": bin_number
}
with open('data/usage_log.json', 'a+') as f:
f.seek(0, os.SEEK_END)
if f.tell() == 0:
json.dump([log_entry], f)
else:
f.seek(0)
data = json.load(f)
data.append(log_entry)
f.seek(0)
f.truncate()
json.dump(data, f)
except Exception as e:
print(f"Error logging usage: {e}")
# Check if user is authorized
def is_authorized(user_id):
return user_id in ALLOWED_USERS or user_id in ADMIN_IDS
# Check if user is admin
def is_admin(user_id):
return user_id in ADMIN_IDS
# Check if BIN is banned
def is_banned_bin(bin_number):
banned_bins = load_banned_bins()
return bin_number in banned_bins
# Check rate limiting
def check_rate_limit(user_id):
current_time = time.time()
if user_id in user_last_request:
time_passed = current_time - user_last_request[user_id]
if time_passed < COOLDOWN_TIME:
return False, int(COOLDOWN_TIME - time_passed)
user_last_request[user_id] = current_time
return True, 0
# Validate BIN number
def is_valid_bin(bin_number):
if not bin_number.isdigit():
return False
if len(bin_number) < 6:
return False
return True
# Get BIN information
async def get_bin_info_async(bin_number):
try:
async with aiohttp.ClientSession() as session:
async with session.get(f"https://lookup.binlist.net/{bin_number}",
headers={"Accept-Version": "3"}) as response:
if response.status == 200:
return await response.json()
# Fallback to secondary BIN service
async with aiohttp.ClientSession() as session:
async with session.get(f"https://bins.antipublic.cc/bins/{bin_number}") as response:
if response.status == 200:
return await response.json()
return None
except:
return None
def get_bin_info(bin_number):
return asyncio.run(get_bin_info_async(bin_number))
# Generate card number with Luhn algorithm
def generate_card(bin_prefix, length=16):
card_number = bin_prefix
while len(card_number) < length - 1:
card_number += str(random.randint(0, 9))
# Luhn algorithm to calculate check digit
digits = [int(d) for d in card_number]
odd_digits = digits[-1::-2]
even_digits = digits[-2::-2]
total = sum(odd_digits)
for d in even_digits:
total += sum(divmod(d * 2, 10))
check_digit = (10 - (total % 10)) % 10
return card_number + str(check_digit)
# Generate random card details
def generate_card_details(custom_month=None, custom_year=None):
if custom_month:
month = str(custom_month).zfill(2)
else:
month = str(random.randint(1, 12)).zfill(2)
current_year = int(time.strftime("%y"))
if custom_year:
year = str(custom_year)
if len(year) == 4:
year = year[2:]
else:
year = str(random.randint(current_year + 1, current_year + 5))
cvv = str(random.randint(100, 999))
return month, year, cvv
# Check cards against external API (hypothetical implementation)
async def check_card_validity(card_data):
try:
card_number, month, year, cvv = card_data.split('|')
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.example.com/check-card",
json={
"card_number": card_number,
"month": month,
"year": year,
"cvv": cvv,
"api_key": CHECKER_API_KEY
}
) as response:
if response.status == 200:
result = await response.json()
return result.get("status", "unknown")
return "error"
except Exception:
return "error"
# Start command handler
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
user_id = message.from_user.id
welcome_text = (
"Welcome to CC Generator Bot!\n\n"
"Commands:\n"
"/gen BIN - Generate credit cards with the specified BIN\n"
"/genx BIN AMOUNT - Generate custom amount of cards\n"
"/bininfo BIN - Get detailed information about a BIN\n"
"/settings - Configure your generator settings\n"
"/help - Show this help message\n\n"
"Examples:\n"
"/gen 446542\n"
"/genx 446542 30\n"
"/bininfo 446542\n\n"
)
if not is_authorized(user_id):
welcome_text += (
"
"Please contact the administrator to request access."
)
if is_admin(user_id):
welcome_text += (
"\nAdmin Commands:\n"
"/adduser USER_ID - Add user to allowed list\n"
"/deluser USER_ID - Remove user from allowed list\n"
"/banbin BIN - Add BIN to banned list\n"
"/unbanbin BIN - Remove BIN from banned list\n"
"/stats - View bot usage statistics\n"
"/broadcast MESSAGE - Send message to all users\n"
)
bot.reply_to(message, welcome_text)
log_usage(user_id, 'start')
# Generate cards command
@bot.message_handler(func=lambda message: message.text.startswith(('/gen', '.gen')))
def generate_cards(message):
user_id = message.from_user.id
if not is_authorized(user_id):
bot.reply_to(message, "
return
# Rate limiting
allowed, wait_time = check_rate_limit(user_id)
if not allowed:
bot.reply_to(message, f"
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /gen 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
if is_banned_bin(bin_number):
bot.reply_to(message, "
return
# Send typing indication
bot.send_chat_action(message.chat.id, 'typing')
# Get BIN info
bin_info = get_bin_info(bin_number)
# Format BIN info text
bin_info_text = "
if bin_info:
bin_info_text = "
bin_info_text += f"• Brand: {bin_info.get('scheme', bin_info.get('brand', 'Unknown')).title()}\n"
bin_info_text += f"• Type: {bin_info.get('type', 'Unknown').title()}\n"
bin_info_text += f"• Level: {bin_info.get('level', 'Unknown').title()}\n"
if 'bank' in bin_info:
bank_name = bin_info['bank'].get('name', 'Unknown')
bin_info_text += f"• Bank: {bank_name}\n"
if 'country' in bin_info:
country_name = bin_info['country'].get('name', 'Unknown')
country_emoji = bin_info['country'].get('emoji', '')
bin_info_text += f"• Country: {country_name} {country_emoji}\n"
# Generate cards
cards = []
amount = 15 # Default amount
for _ in range(amount):
card_number = generate_card(bin_number)
month, year, cvv = generate_card_details()
cards.append(f"{card_number}|{month}|{year}|{cvv}")
# Format response message
message_text = f"""••• CC GENERATOR
•Format Used: {bin_number}|MM|YY|CVV
{bin_info_text}
Generated Cards:
"""
message_text += "\n".join(cards)
bot.reply_to(message, message_text)
log_usage(user_id, 'gen', bin_number)
# Generate custom amount of cards command
@bot.message_handler(func=lambda message: message.text.startswith(('/genx', '.genx')))
def generate_custom_cards(message):
user_id = message.from_user.id
if not is_authorized(user_id):
bot.reply_to(message, "
return
# Rate limiting
allowed, wait_time = check_rate_limit(user_id)
if not allowed:
bot.reply_to(message, f"
return
command_parts = message.text.split()
if len(command_parts) < 3:
bot.reply_to(message, "Please provide a BIN number and amount. Example: /genx 446542 30")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
if is_banned_bin(bin_number):
bot.reply_to(message, "
return
try:
amount = int(command_parts[2])
if amount > MAX_CARDS_PER_REQUEST:
bot.reply_to(message, f"
return
except ValueError:
bot.reply_to(message, "Invalid amount. Please provide a valid number.")
return
# Send typing indication
bot.send_chat_action(message.chat.id, 'typing')
# Get BIN info
bin_info = get_bin_info(bin_number)
# Format BIN info text
bin_info_text = "
if bin_info:
bin_info_text = "
bin_info_text += f"• Brand: {bin_info.get('scheme', bin_info.get('brand', 'Unknown')).title()}\n"
bin_info_text += f"• Type: {bin_info.get('type', 'Unknown').title()}\n"
bin_info_text += f"• Level: {bin_info.get('level', 'Unknown').title()}\n"
if 'bank' in bin_info:
bank_name = bin_info['bank'].get('name', 'Unknown')
bin_info_text += f"• Bank: {bank_name}\n"
if 'country' in bin_info:
country_name = bin_info['country'].get('name', 'Unknown')
country_emoji = bin_info['country'].get('emoji', '')
bin_info_text += f"• Country: {country_name} {country_emoji}\n"
# Generate cards
cards = []
for _ in range(amount):
card_number = generate_card(bin_number)
month, year, cvv = generate_card_details()
cards.append(f"{card_number}|{month}|{year}|{cvv}")
# Format response message
message_text = f"""••• CC GENERATOR
•Format Used: {bin_number}|MM|YY|CVV
{bin_info_text}
Generated Cards:
"""
message_text += "\n".join(cards)
bot.reply_to(message, message_text)
log_usage(user_id, 'genx', bin_number)
# Get BIN info command
@bot.message_handler(func=lambda message: message.text.startswith(('/bininfo', '.bininfo')))
def get_bin_info_command(message):
user_id = message.from_user.id
if not is_authorized(user_id):
bot.reply_to(message, "
return
# Rate limiting
allowed, wait_time = check_rate_limit(user_id)
if not allowed:
bot.reply_to(message, f"
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /bininfo 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
# Send typing indication
bot.send_chat_action(message.chat.id, 'typing')
# Get BIN info
bin_info = get_bin_info(bin_number)
# Format BIN info text
bin_info_text = "
if bin_info:
bin_info_text = "
bin_info_text += f"• Brand: {bin_info.get('scheme', bin_info.get('brand', 'Unknown')).title()}\n"
bin_info_text += f"• Type: {bin_info.get('type', 'Unknown').title()}\n"
bin_info_text += f"• Level: {bin_info.get('level', 'Unknown').title()}\n"
if 'bank' in bin_info:
bank_name = bin_info['bank'].get('name', 'Unknown')
bin_info_text += f"• Bank: {bank_name}\n"
if 'country' in bin_info:
country_name = bin_info['country'].get('name', 'Unknown')
country_emoji = bin_info['country'].get('emoji', '')
bin_info_text += f"• Country: {country_name} {country_emoji}\n"
bot.reply_to(message, bin_info_text)
log_usage(user_id, 'bininfo', bin_number)
# Admin command to add user to allowed list
@bot.message_handler(func=lambda message: message.text.startswith(('/adduser', '.adduser')))
def add_user(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a user ID. Example: /adduser 123456789")
return
try:
new_user_id = int(command_parts[1])
except ValueError:
bot.reply_to(message, "Invalid user ID. Please provide a valid number.")
return
ALLOWED_USERS.add(new_user_id)
save_allowed_users()
bot.reply_to(message, f"User {new_user_id} has been added to the allowed list.")
log_usage(user_id, 'adduser')
# Admin command to remove user from allowed list
@bot.message_handler(func=lambda message: message.text.startswith(('/deluser', '.deluser')))
def remove_user(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a user ID. Example: /deluser 123456789")
return
try:
user_id_to_remove = int(command_parts[1])
except ValueError:
bot.reply_to(message, "Invalid user ID. Please provide a valid number.")
return
if user_id_to_remove in ALLOWED_USERS:
ALLOWED_USERS.remove(user_id_to_remove)
save_allowed_users()
bot.reply_to(message, f"User {user_id_to_remove} has been removed from the allowed list.")
else:
bot.reply_to(message, f"User {user_id_to_remove} is not in the allowed list.")
log_usage(user_id, 'deluser')
# Admin command to ban a BIN
@bot.message_handler(func=lambda message: message.text.startswith(('/banbin', '.banbin')))
def ban_bin(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /banbin 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
banned_bins = load_banned_bins()
if bin_number not in banned_bins:
with open('data/banned_bins.txt', 'a') as f:
f.write(f"{bin_number}\n")
bot.reply_to(message, f"BIN {bin_number} has been banned.")
else:
bot.reply_to(message, f"BIN {bin_number} is already banned.")
log_usage(user_id, 'banbin', bin_number)
# Admin command to unban a BIN
@bot.message_handler(func=lambda message: message.text.startswith(('/unbanbin', '.unbanbin')))
def unban_bin(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
return
command_parts = message.text.split()
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a BIN number. Example: /unbanbin 446542")
return
bin_number = command_parts[1]
if not is_valid_bin(bin_number):
bot.reply_to(message, "Invalid BIN. Please provide a valid 6-digit BIN.")
return
banned_bins = load_banned_bins()
if bin_number in banned_bins:
banned_bins.remove(bin_number)
with open('data/banned_bins.txt', 'w') as f:
f.write("\n".join(banned_bins))
bot.reply_to(message, f"BIN {bin_number} has been unbanned.")
else:
bot.reply_to(message, f"BIN {bin_number} is not banned.")
log_usage(user_id, 'unbanbin', bin_number)
# Admin command to view bot usage statistics
@bot.message_handler(func=lambda message: message.text.startswith(('/stats', '.stats')))
def view_stats(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
return
try:
with open('data/usage_log.json', 'r') as f:
usage_data = json.load(f)
stats_text = "Bot Usage Statistics:\n"
stats_text += f"Total Commands: {len(usage_data)}\n"
command_counts = {}
for entry in usage_data:
command = entry['command']
if command in command_counts:
command_counts[command] += 1
else:
command_counts[command] = 1
for command, count in command_counts.items():
stats_text += f"• {command.capitalize()}: {count}\n"
bot.reply_to(message, stats_text)
except Exception as e:
bot.reply_to(message, f"Error retrieving statistics: {e}")
log_usage(user_id, 'stats')
# Admin command to broadcast a message to all users
@bot.message_handler(func=lambda message: message.text.startswith(('/broadcast', '.broadcast')))
def broadcast_message(message):
user_id = message.from_user.id
if not is_admin(user_id):
bot.reply_to(message, "
return
command_parts = message.text.split(maxsplit=1)
if len(command_parts) < 2:
bot.reply_to(message, "Please provide a message to broadcast. Example: /broadcast Hello everyone!")
return
broadcast_text = command_parts[1]
for allowed_user_id in ALLOWED_USERS:
bot.send_message(allowed_user_id, broadcast_text)
bot.reply_to(message, "Broadcast sent to all users.")
log_usage(user_id, 'broadcast')
# Start the bot
load_allowed_users()
bot.polling()