| import discord |
| from discord.ext import commands |
| from discord import app_commands |
| import random |
| import asyncio |
| from datetime import datetime |
|
|
| CYBER_BLUE = discord.Color.from_rgb(52, 152, 219) |
| CYBER_ORANGE = discord.Color.from_rgb(230, 126, 34) |
| CYBER_GREEN = discord.Color.from_rgb(46, 204, 113) |
| CYBER_RED = discord.Color.from_rgb(231, 76, 60) |
|
|
| ESPRILER = [ |
| "Geçen gün bir taksi çevirdim, hala dönüyor.", |
| "Adamın biri gülmüş, saksıya koymuşlar.", |
| "Rüzgar esmiş, fırtına çıkmış, ben çıkamamışım.", |
| "Sinemada on dakika ara verdi, ben vermedim.", |
| "Geçen gün bir yazı yazdım, mürekkep bitti, tükenmez kalemle devam ettim.", |
| "Yıkanan ton balığına ne denir? Yıkanmış ton balığı.", |
| "Ben yürüyelim diyorum, o yollar yürümekle aşınmaz diyor.", |
| "En temiz böcek hangisidir? Hamam böceği.", |
| "Soru: Adamın biri uçurumdan atlayacakmış, vazgeçmiş neden? Çünkü vazgeçmiş.", |
| "Su içmek ücretsiz, ama su faturası ücretli. Hayat paradoks.", |
| "İki sıfır bir görüşmüş, üç olmak için.", |
| "Çöpçü olmak istiyorum, hayatta bir şeyleri çöp etmek için." |
| ] |
|
|
| TRIVIA_QUESTIONS = [ |
| {"q": "Türkiye Cumhuriyeti'nin kurucusu kimdir?", "a": "atatürk"}, |
| {"q": "Gökyüzü neden mavi görünür?", "a": "saçılma"}, |
| {"q": "Dünyanın en yüksek dağı hangisidir?", "a": "everest"}, |
| {"q": "Suyu oluşturan hidrojen ve hangi elementtir?", "a": "oksijen"}, |
| {"q": "İstiklal Marşı'mızın şairi kimdir?", "a": "mehmet akif"}, |
| {"q": "İstanbul hangi yıl fethedilmiştir?", "a": "1453"}, |
| {"q": "Kız Kulesi hangi şehrimizdedir?", "a": "istanbul"}, |
| {"q": "Dünya Güneş etrafındaki dönüşünü kaç günde tamamlar?", "a": "365"}, |
| {"q": "Python programlama dilini kim yarattı?", "a": "guido"}, |
| {"q": "Dünyanın en büyük okyanusu hangisidir?", "a": "pasifik"}, |
| {"q": "Discord hangi yılda kurulmuştur?", "a": "2015"}, |
| {"q": "Pi sayısının ilk üç hanesi nedir?", "a": "3.14"}, |
| {"q": "Türkiye'nin başkenti neresidir?", "a": "ankara"}, |
| {"q": "HTML neyin kısaltmasıdır?", "a": "hypertext"}, |
| {"q": "Avrupa'nın en büyük ülkesi hangisidir?", "a": "rusya"}, |
| ] |
|
|
| |
| ACTIVE_TRIVIA = set() |
|
|
|
|
| class Fun(commands.Cog): |
| def __init__(self, bot): |
| self.bot = bot |
|
|
| @commands.command(name="yazıtura", description="Yazı mı tura mı? Parayı fırlatır.") |
| async def yazitura(self, ctx: commands.Context): |
| result = random.choice(["Yazı ✍️", "Tura 🔵"]) |
| embed = discord.Embed( |
| title="🪙 Yazı Tura", |
| description=f"{ctx.author.mention} parayı fırlatıyor...\n\n⏳ *Para havada dönüyor...*", |
| color=CYBER_ORANGE |
| ) |
| msg = await ctx.send(embed=embed) |
| await asyncio.sleep(1.5) |
| embed.description = f"{ctx.author.mention} parayı fırlattı!\n\n🪙 Sonuç: **{result}**" |
| await msg.edit(embed=embed) |
|
|
| @commands.command(name="zar-at", description="6 yüzlü bir zar atar.") |
| async def zar_at(self, ctx: commands.Context): |
| zar_gorselleri = {1: "⚀", 2: "⚁", 3: "⚂", 4: "⚃", 5: "⚄", 6: "⚅"} |
| zar = random.randint(1, 6) |
| embed = discord.Embed( |
| title="🎲 Zar Atıldı", |
| description=f"{ctx.author.mention} zarı attı!\n\n{zar_gorselleri[zar]} **{zar}** geldi!", |
| color=CYBER_BLUE |
| ) |
| await ctx.send(embed=embed) |
|
|
| @commands.command(name="aşk-ölçer", description="İki üye arasındaki aşk uyumunu ölçer.") |
| async def ask_olcer(self, ctx: commands.Context, uye1: discord.Member, uye2: discord.Member = None): |
| if uye2 is None: |
| uye2 = ctx.author |
|
|
| oran = random.randint(0, 100) |
|
|
| if oran < 30: |
| mesaj = "💔 Pek umut yok gibi duruyor, arkadaş kalmanız daha hayırlı." |
| elif oran < 60: |
| mesaj = "💛 İdare eder bir çekim var ama çabalamanız lazım." |
| elif oran < 85: |
| mesaj = "💖 Harika bir uyum! Gelecek vadediyor." |
| else: |
| mesaj = "💞 Efsanevi Aşk! Bir elmanın iki yarısı gibisiniz!" |
|
|
| dolu_blok = int(oran / 10) |
| bos_blok = 10 - dolu_blok |
| cubuk = "❤️" * dolu_blok + "🖤" * bos_blok |
|
|
| embed = discord.Embed( |
| title="💘 Aşk Ölçer", |
| description=( |
| f"💘 **{uye1.display_name}** ile **{uye2.display_name}** arasındaki aşk oranı:\n\n" |
| f"**Oran:** `%{oran}`\n" |
| f"{cubuk}\n\n" |
| f"{mesaj}" |
| ), |
| color=discord.Color.from_rgb(231, 76, 60), |
| timestamp=datetime.now() |
| ) |
| await ctx.send(embed=embed) |
|
|
| @commands.command(name="slot", description="Şansınızı meyve slot makinesinde deneyin.") |
| async def slot(self, ctx: commands.Context): |
| emoji_list = ["🍎", "🍋", "🍇", "🍒", "💎", "⭐", "🍉", "🔔"] |
| slot1 = random.choice(emoji_list) |
| slot2 = random.choice(emoji_list) |
| slot3 = random.choice(emoji_list) |
|
|
| if slot1 == slot2 == slot3: |
| status = "🎉 **TEBRİKLER! JACKPOT!** 🎉" |
| color = CYBER_GREEN |
| elif slot1 == slot2 or slot2 == slot3 or slot1 == slot3: |
| status = "✨ **Çok yakındı! Amorti aldınız!** ✨" |
| color = CYBER_BLUE |
| else: |
| status = "❌ **Kaybettiniz. Tekrar deneyin!** ❌" |
| color = CYBER_RED |
|
|
| embed = discord.Embed( |
| title="🎰 Slot Makinesi", |
| description="🎰 Makine dönüyor...\n\n`[ ⌛ | ⌛ | ⌛ ]`", |
| color=CYBER_ORANGE |
| ) |
| msg = await ctx.send(embed=embed) |
| await asyncio.sleep(1.5) |
| embed.title = "🎰 Slot Sonucu" |
| embed.description = f"{ctx.author.mention} slot çevirdi:\n\n`[ {slot1} | {slot2} | {slot3} ]`\n\n{status}" |
| embed.color = color |
| await msg.edit(embed=embed) |
|
|
| @commands.command(name="espri", description="Komik/soğuk bir espri yapar.") |
| async def espri(self, ctx: commands.Context): |
| random_espri = random.choice(ESPRILER) |
| embed = discord.Embed( |
| title="😂 Günün Esprisi", |
| description=f"*{random_espri}*", |
| color=CYBER_ORANGE |
| ) |
| await ctx.send(embed=embed) |
|
|
| @commands.command(name="bilgi-yarışması", description="Genel kültür bilgi yarışması başlatır.") |
| async def bilgi_yarismasi(self, ctx: commands.Context): |
| channel_id = ctx.channel.id |
|
|
| |
| if channel_id in ACTIVE_TRIVIA: |
| await ctx.send("⚠️ Bu kanalda zaten devam eden bir bilgi yarışması var! Önce bitmesini bekleyin.") |
| return |
|
|
| ACTIVE_TRIVIA.add(channel_id) |
| question_data = random.choice(TRIVIA_QUESTIONS) |
| correct_answer = question_data['a'] |
|
|
| try: |
| embed = discord.Embed( |
| title="🧠 Bilgi Yarışması Başladı!", |
| description=( |
| f"**Soru:** {question_data['q']}\n\n" |
| f"⏱️ *Cevap vermek için 30 saniyeniz var!*\n" |
| f"💡 *Cevabınızı buraya yazın.*" |
| ), |
| color=CYBER_BLUE, |
| timestamp=datetime.now() |
| ) |
| embed.set_footer(text="ArazAI Bot • Bilgi Yarışması") |
|
|
| await ctx.send(embed=embed) |
|
|
| |
| def check(m: discord.Message): |
| return ( |
| m.channel.id == channel_id |
| and not m.author.bot |
| and correct_answer.lower() in m.content.lower() |
| ) |
|
|
| try: |
| msg = await self.bot.wait_for("message", check=check, timeout=30.0) |
|
|
| success_embed = discord.Embed( |
| title="🏆 Doğru Cevap Verildi!", |
| description=( |
| f"Tebrikler {msg.author.mention}! 🎉\n\n" |
| f"**Soru:** {question_data['q']}\n" |
| f"**Doğru Cevap:** {question_data['a'].title()}" |
| ), |
| color=CYBER_GREEN, |
| timestamp=datetime.now() |
| ) |
| success_embed.set_thumbnail(url=msg.author.display_avatar.url) |
| await ctx.channel.send(embed=success_embed) |
|
|
| except asyncio.TimeoutError: |
| timeout_embed = discord.Embed( |
| title="⏰ Süre Doldu!", |
| description=( |
| f"Kimse doğru cevabı veremedi. 😔\n\n" |
| f"**Soru:** {question_data['q']}\n" |
| f"**Doğru Cevap:** {question_data['a'].title()}" |
| ), |
| color=CYBER_RED, |
| timestamp=datetime.now() |
| ) |
| await ctx.channel.send(embed=timeout_embed) |
|
|
| finally: |
| |
| ACTIVE_TRIVIA.discard(channel_id) |
|
|
| @commands.command(name="avatar", description="Belirtilen üyenin avatarını büyük boyutta gösterir.") |
| async def avatar(self, ctx: commands.Context, member: discord.Member = None): |
| member = member or ctx.author |
| embed = discord.Embed( |
| title=f"🖼️ {member.display_name} Avatarı", |
| color=CYBER_BLUE |
| ) |
| embed.set_image(url=member.display_avatar.url) |
| embed.set_footer(text=f"İstekte bulunan: {ctx.author.display_name}") |
| await ctx.send(embed=embed) |
|
|
| @commands.command(name="8top", description="Sihirli 8 top ile sorunuzu yanıtlar.") |
| async def sekiz_top(self, ctx: commands.Context, *, soru: str): |
| cevaplar = [ |
| "✅ Kesinlikle evet!", "✅ Buna kesin olarak güvenebilirsin.", |
| "✅ Evet, şüphesiz.", "✅ Görünüşe göre evet.", |
| "🤔 Cevabım belirsiz, tekrar dene.", "🤔 Şimdi tahmin edemiyorum.", |
| "🤔 Şimdi sorma, daha sonra sor.", "🤔 Daha fazla konsantre ol ve tekrar sor.", |
| "❌ Buna güvenme.", "❌ Cevabım hayır.", "❌ Görünüşe göre hayır.", "❌ Kesinlikle hayır." |
| ] |
| cevap = random.choice(cevaplar) |
| embed = discord.Embed( |
| title="🎱 Sihirli 8 Top", |
| description=f"**Soru:** {soru}\n\n**Cevap:** {cevap}", |
| color=CYBER_BLUE |
| ) |
| await ctx.send(embed=embed) |
|
|
|
|
| async def setup(bot): |
| await bot.add_cog(Fun(bot)) |
|
|