Skip to content

Bot — Erste Schritte

Installation

bash
pip install nexcord

Minimaler Bot

python
import nexcord

TOKEN = 'DEIN_BOT_TOKEN'

bot = nexcord.Client(token=TOKEN, prefix='!')

@bot.listen('on_ready')
async def on_ready(data):
    print(f'Bot gestartet als {bot.account.username}')

@bot.command()
async def ping(ctx):
    await ctx.send('Pong! 🏓')

bot.run()

Bot erstellen

  1. Gehe zu nexcord.de → Einstellungen → Bots & Apps
  2. Klicke auf Neue App erstellen
  3. Unter „Bot" → Bot hinzufügen
  4. Token kopieren

Bot zu einem Server hinzufügen

Nutze die Authorize-URL:

https://nexcord.de/authorize
  ?clientId=DEINE_CLIENT_ID
  &scopes=bot
  &redirectUri=https://nexcord.de

Nächste Schritte

Nexcord — Self-hosted Chat Platform