Python ile Discord Bot Yapımı: Komut Sistemi

Python ile Discord Bot Yapımı: Komut Sistemi

NBK BARIS2 Mayıs 2026Python, Discord-bot-kodlari
Python discord.py ile Komut Sistemi

Cog Sistemi ile Organize Komutlar

# (c) CodeMareFi - codemarefi.com.tr
import discord
from discord.ext import commands

class Genel(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command(name='ping')
    async def ping(self, ctx):
        await ctx.send(f'Pong! {round(self.bot.latency * 1000)}ms')

    @commands.command(name='sunucu')
    async def sunucu(self, ctx):
        embed = discord.Embed(title=ctx.guild.name, color=0xe60000)
        embed.add_field(name='Uye Sayisi', value=ctx.guild.member_count)
        embed.set_footer(text='CodeMareFi')
        await ctx.send(embed=embed)

async def setup(bot):
    await bot.add_cog(Genel(bot))
© CodeMareFi Bu icerik codemarefi.com.tr ye aittir.

0 Yorum

YORUM YAPMAK İÇİN SİSTEME SIZMANIZ GEREKİYOR

Lütfen yukarıdaki butonu kullanarak giriş yapın veya kimlik oluşturun.

Yorumlar yükleniyor...