✳ COGAS / Docs
BUILD YOUR COMMUNITY

A place for your people.
A toolkit for you.

Topluluğunun yeri.
Araçların burada.

Servers, granular permissions, free profiles and your own Python bots. Start here.

Sunucular, ayrıntılı izinler, ücretsiz profiller ve kendi Python botların. Buradan başla.

01 / Getting started · Başlangıç

Create an account or sign in. Use the + on the server rail to create a server or paste an invite. Add channels with the + next to TEXT CHANNELS. Invite people through Server settings → Invite.

Search filters the latest 200 loaded messages. Use message actions to reply, react, edit, delete or pin according to your permissions. Ctrl/⌘ + K focuses search.

Hesap oluştur veya giriş yap. Soldaki + ile sunucu oluştur ya da davet yapıştır. Kanal listesindeki + ile kanal ekle. Sunucu ayarları → Davet üzerinden arkadaşlarını çağır.

Arama yüklenen son 200 mesajı tarar. İzinlerine göre yanıtla, tepki ver, düzenle, sil veya sabitle. Ctrl/⌘ + K aramaya geçer.

02 / Roles & permissions · Roller ve izinler

Open Roles & members. Create roles, choose permissions, drag to reorder, then select a member to assign multiple roles. You can manage only roles and members below your highest role. The server owner has full access.

Channel header → ⚙ opens channel settings: name, topic, slowmode and permission overrides. Each permission has Deny / Inherit / Allow. COGAS combines @everyone and server roles, applies @everyone overrides, combines role overrides, then applies member overrides. Administrator bypasses channel restrictions, but not role hierarchy.

Timeout temporarily prevents sending and reacting. Kick removes a member; ban also blocks rejoining until lifted. Private channels require View Channel permission. Bot channel scopes further restrict normal role access.

Roller ve üyeler ekranında rol oluştur, izinlerini seç, sürükleyerek sırala. Üyeye birden fazla rol atayabilirsin. Yalnızca kendi en yüksek rolünün altındaki rolleri ve üyeleri yönetebilirsin. Sunucu sahibi tam erişime sahiptir.

Kanal başlığındaki ⚙ ile ad, konu, yavaş mod ve izinleri düzenle. Her izin Reddet / Devral / İzin ver şeklindedir. @everyone ve sunucu rolleri birleşir; kanalın @everyone istisnası, rol istisnaları ve son olarak üyeye özel istisnası uygulanır. Yönetici kanal kısıtlamalarını aşar, rol hiyerarşisini aşmaz.

Zaman aşımı yazmayı ve tepki vermeyi geçici engeller. Atılan üye davetle dönebilir; yasaklanan üye yasak kalkmadan dönemez. Botların kanal kapsamı normal rol izinlerini ayrıca sınırlar.

03 / Profiles & themes · Profil ve temalar

Appearance & account offers Dark, Light, Midnight, Forest and Sunset, compact messages and language selection. English is the default. Preferences stay in this browser. Profile editing includes avatar upload, bio, pronouns, banner color, effects, tags and five name fonts. Profile changes are shared with the server; all options are free.

Görünüm ve hesap: Dark, Light, Midnight, Forest, Sunset temaları; kompakt mesajlar ve dil seçimi. Varsayılan İngilizcedir. Tercihler bu tarayıcıda saklanır. Profilinde fotoğraf, biyografi, hitap, renk, efekt, etiket ve beş ad fontu seçebilirsin. Profil değişikliklerini diğer üyeler de görür. Hepsi ücretsiz.

04 / Python bots

Open Python bots in the sidebar (Manage Bots permission required). Choose a name and allowed channels. Copy the token shown once. Bots are ordinary server members: assign roles and private-channel access in Roles & members. A bot can only access channels in its creation scope and allowed by its current roles. Create a new bot to change its scope.

Download both files into the same folder. Python 3.10+ is enough; no packages required. Run on your computer or your own host. COGAS does not execute uploaded Python code.

Soldaki Python bots ekranını aç (Botları Yönet izni gerekli). Ad ve kanalları seç, bir kez gösterilen anahtarı kopyala. Bot normal sunucu üyesidir: Roller ve üyelerden rol ve özel kanal izinlerini ver. Hem oluştururken seçilen kanallar hem güncel rol izinleri geçerlidir. Kanal kapsamını değiştirmek için yeni bot oluştur.

İki dosyayı aynı klasöre indir. Python 3.10+ yeterli; paket kurmak gerekmez. Bilgisayarında veya kendi sunucunda çalıştır. COGAS yüklenen Python kodunu çalıştırmaz.

Download cogas.py · Download example_bot.py · SDK guide

# PowerShell — paste your own bot token locally
$env:COGAS_BOT_TOKEN = 'YOUR_BOT_TOKEN'
$env:COGAS_URL = 'http://127.0.0.1:5000'
python example_bot.py
from cogas import Bot

bot = Bot()  # reads COGAS_BOT_TOKEN

@bot.command('ping')
def ping(message, args):
    return f'Pong, {message.username}!'

bot.run()

Send !ping in a permitted channel. Keep the bot process running. The SDK checkpoints its event cursor; reply nonces prevent duplicate replies on retry. Events are message creations only, not edits or reactions. Rotate invalidates the old token immediately; Revoke disables the bot and removes its membership. Tokens are stored hashed.

İzinli kanalda !ping yaz. Bot işlemi açık kalmalı. SDK olay sırasını dosyada saklar; yanıt nonce değerleri yeniden denemelerde çift yanıtı önler. Olaylar yeni mesajlardır; düzenlemeler ve tepkiler dahil değildir. Rotate eski anahtarı anında geçersiz kılar; Revoke botu devre dışı bırakır. Anahtarlar özetlenerek saklanır.

05 / Bot HTTP API

Authorization: Bot YOUR_BOT_TOKEN · JSON request/response

Method / pathBehavior
GET /api/bot/meBot identity, accessible channels, latest cursor
GET /api/bot/events?after=123Up to 100 scanned human messages, filtered by permissions; next_cursor
POST /api/bot/messages{"room":"channel-key","text":"Hello","nonce":"unique-reply-id"}
POST /api/bot/messages/123/deleteDelete own bot message

Use channel keys returned by /me, not display names. Messages: 1–2000 characters. Send limit: one per 0.5 seconds plus channel slowmode. Respect 429 and retry later. Handle 401/403 by checking tokens and permissions. Retry the same payload with the same nonce for idempotent delivery. Never put tokens in messages, source control or browser URLs.

/me yanıtındaki kanal anahtarını kullan. Mesajlar 1–2000 karakterdir. Gönderim aralığı en az 0,5 saniye ve kanal yavaş modudur. 429 durumunda bekle. 401/403 durumunda anahtar ve izinleri kontrol et. Aynı gönderimi aynı nonce ile yeniden dene. Anahtarı sohbete, kaynak kontrolüne veya URL'ye koyma.

06 / kAUTh sign-in

COGAS supports your kAUTh OAuth provider using Authorization Code + S256 PKCE. Register COGAS as an application in kAUTh with an exact callback URL. A live HTTPS provider needs an HTTPS callback. For local testing, a development-mode provider can accept localhost callbacks.

COGAS, kAUTh OAuth sağlayıcını Authorization Code + S256 PKCE ile destekler. kAUTh üzerinde COGAS uygulamasını tam callback adresiyle kaydet. Canlı sağlayıcı HTTPS callback ister. Yerel test için geliştirme modundaki sağlayıcı localhost callback kabul edebilir.

# Set before starting app.py
$env:COGAS_KAUTH_URL = 'https://auth.kcodeio.com'
$env:COGAS_KAUTH_CLIENT_ID = 'ka_at7wI8koHZE_vcZDQ8KGC3OWDTdQCZ0a'
$env:COGAS_KAUTH_REDIRECT_URI = 'https://cogas.kcodeio.com'
python app.py

Alternatively create kauth.config.json beside app.py with url, client_id, redirect_uri fields. No client secret is required by the current public-client kAUTh flow. COGAS uses /oauth/authorize, /oauth/token and /api/v1/me. Login is enabled when configured. Each provider subject maps to its own account; existing password accounts are not automatically linked by username or email. State expires after 10 minutes and is single-use. Provider access tokens are not persisted.

Alternatif olarak app.py yanında url, client_id, redirect_uri alanlarıyla kauth.config.json oluştur. Mevcut public-client kAUTh akışı client secret gerektirmez. /oauth/authorize, /oauth/token ve /api/v1/me kullanılır. Yapılandırılınca giriş etkinleşir. Sağlayıcı kimliği ayrı hesaba eşlenir; mevcut şifreli hesaplar ad veya e-postayla otomatik birleştirilmez. Giriş durumu 10 dakikalık ve tek kullanımlıktır. Sağlayıcı tokenları saklanmaz.

07 / Running COGAS

Install requirements.txt, then run python app.py. Default: http://127.0.0.1:5000. Keep cogas.db and .secret_key when updating; back them up together. To share outside your computer, configure an HTTPS reverse proxy with WebSocket support. Set SECRET_KEY securely and enable secure session cookies behind HTTPS. This local development server is not a completed public hosting setup.

Current scope: text communities, roles, bots and profiles. Voice/video calls, file sharing, push delivery and full Discord API compatibility are not implemented. Python bots use COGAS's own SDK; discord.py bots need adaptation.

requirements.txt paketlerini kur, python app.py çalıştır. Varsayılan adres http://127.0.0.1:5000. Güncellerken cogas.db ve .secret_key dosyalarını koru ve birlikte yedekle. Dış erişim için WebSocket destekleyen HTTPS reverse proxy kur. SECRET_KEY ve güvenli oturum çerezlerini yapılandır. Yerel geliştirme sunucusu tamamlanmış bir genel hosting kurulumu değildir.

Mevcut kapsam: yazılı topluluklar, roller, botlar ve profiller. Ses/video, dosya paylaşımı, push iletimi ve tam Discord API uyumluluğu henüz yoktur. Python botları COGAS SDK kullanır; discord.py botları uyarlanmalıdır.