Untitled
unknown
python
20 days ago
955 B
4
Indexable
Never
import discord import requests TOKEN = "TOKEN_DO_BOT" WEBHOOK_URL = "WEBHOOK_URL_DO_SERVIDOR_NIGHTSHADOW" intents = discord.Intents.default() intents.messages = True client = discord.Client(intents=intents) @client.event async def on_ready(): print(f'Logado como {client.user}!') @client.event async def on_message(message): if message.author == client.user: return if message.guild and message.guild.name == "Disclound": webhook_data = { "content": message.content, "username": message.author.name, "avatar_url": str(message.author.avatar_url) } response = requests.post(WEBHOOK_URL, json=webhook_data) if response.status_code == 204: print("Mensagem enviada para o NightShadow com sucesso!") else: print(f"Erro ao enviar mensagem: {response.status_code}") client.run(TOKEN)
Leave a Comment