Git Product home page Git Product logo

disnake-easy-botbase's Introduction

Easy Bot Base Class für den Disnake API Wrapper

Dient dazu schnell eine Bot Klasse zu erstellen und Cogs zu übergeben.


⚠️ Dieses Projekt ist noch in Entwicklung.


Dokumentation:

Die Bot Klasse erbt direkt von der disnake.Bot Klasse aus der Disnake API Wrapper Library zum erstellen von Discord Bots.

Klasse

Bot(mode: mode: Literal["test", "deploy"],
    deploy_cogs: list[commands.Cog] = None,
    test_cogs: list[commands.Cog] = None,
    guilds: list[int] = None,
    **weitere)

Parameter

  • mode Required(Literal["test", "deploy"])

    • Bestimmt den Modus in dem der Bot läuft, test wenn der Bot in der Entwicklungsumgebung gestartet wird und deploy wenn der Bot in der Produktionsumgebung läuft. Dabei werden entsprechend die zugehörigen Cogs geladen und der entsprechende Bot Token verwendet. Diese müssen in der config.py eingestellt werden.
  • deploy_cogs Optional(list[commands.Cog]) -> Default(None)

    • Lädt, wenn mode deploy aktiviert, die angegebenen Cogs in den Bot.
  • test_cogs Optional(list[commands.Cog]) -> Default(None)

    • Lädt, wenn mode test aktiviert, die angegebenen Cogs in den Bot.
  • guilds Optional(list[int]) -> Default(None)

  • status Optional(disnake.Status) -> Default(disnake.Status.online)

  • deploy_prefix Optional(str) -> Default("$")

  • test_prefix Optional(str) -> Default("§")

  • cache_messages Optional(int) -> Default(0)

Nutzung:

Botbase Klasse, einfache Verwendung

from bot_base import Botbase

from cogs.tiktaktoe import TicTacToeCog
from cogs.moderation import ModeratinsCog

bot = Botbase(
    mode="test",
    deploy_cogs=[
        # importiere deine Deploy-Cogs hier
      TicTacToeCog
    ],
    test_cogs=[
        # importiere deine Test-Cogs hier
      ModeratinsCog
    ]
)

@bot.event
async def on_ready():
    print("gestartet...")

Konfiguration der config.py

# Bot Tokens
TEST_TOKEN = "<your-token>"
DEPLOY_TOKEN = "<your-token>"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.