Kod:
import discord
from discord.ext import commands
import os
intents = discord.Intents.default()
intents.messages = True
intents.members = True
bot = commands.Bot(command_prefix='!', intents=intents)
FAKE_MSG = (
"ANASI SIKILDI PCNIN KARDEŞİM"
)
@bot.event
async def on_ready():
print(f"Bot hazır: {bot.user} (id: {bot.user.id})")
Örnek komut: !fakecrash <kullanıcı_id>
Komutu sadece bot sahibi/izinli kişi çalıştırmalı
@bot.command()
@commands.is_owner()
async def fakecrash(ctx, user_id: int):
try:
user = await bot.fetch_user(user_id)
if user is None:
await ctx.send("Kullanıcı bulunamadı.")
return
# Optional: küçük görsel oluşturup ekle (lokalde 'fake_crash.png' olmalı)
file_to_send = None
if os.path.exists("fake_crash.png"):
file_to_send = discord.File("fake_crash.png", filename="fake_crash.png")
# DM gönder
try:
if file_to_send:
await user.send(FAKE_MSG, file=file_to_send)
else:
await user.send(FAKE_MSG)
await ctx.send(f"Sahte çökme bildirimi {user} (id:{user_id})'e gönderildi.")
except discord.Forbidden:
await ctx.send("Kullanıcı DM almayı kapatmış olabilir.")
except Exception as e:
await ctx.send(f"Hata: {e}")
çalıştırma: BOT_TOKEN environment değişkeninde olsun
if name == "main":
token = os.environ.get("BOT_TOKEN")
if not token:
print("Lütfen BOT_TOKEN environment değişkenine bot token'ını koy.")
else:
bot.run(token)