Skip to main content

Python Library for creating Geometry Dash Comment Bots.

Project description

GDBot.py

Python Library for creating Geometry Dash Comment Bots. More info about this later (probably) (Pretty much inspired by Discord.py along with CallocGD's GD-Comment-Bot-Wrapper project)

Examples

Simple Bot

mmmmmmmmmmm

from gdbot import GDBot

# Configure our login.
bot = GDBot("USERNAME", "PASSWORD", "LEVEL ID")

# Code to execute when ready.
@bot.on_ready
def ready(bot: GDBot):
    print(f"Bot is ready and logged in as {bot.username}")

# Code to execute when error (WIP idc)
@bot.on_error
def error(bot: GDBot, err: Exception):
    print(f"Err: {err}")

# Code to execute when banned (temporary or permanantly [unused])
@bot.on_banned
def banned(bot: GDBot):
    print(f"Bot has been banned.")

# Simple command returning "Hello SevenworksGD!"
@bot.command("/hello")
def hello(bot: GDBot, data: dict):
    bot.comment(f'Hello {data.get("username")}!')

# Simple command returning your accountID.
@bot.command("/getMyAccID")
def hello(bot: GDBot, data: dict):
    bot.comment(f'{data.get("username")} accountID: [{data.get("accountID")}]')

# Simple command using arguments.
@bot.command("/shut")
def hello(bot: GDBot, data: dict):
    un = data.get("comment").split("/shut ")[1]
	if un:
        bot.comment(f'{data.get("username")} told you to shut yo mouth {un}')
    else:
	    bot.comment(f'@{data.get("username")} usage: /shut [target user]')

bot.run()

Simple Bot (Loading Commands)

from gdbot import GDBot

# Configure our login.
bot = GDBot("USERNAME", "PASSWORD", "LEVEL ID")

# Code to execute when ready.
@bot.on_ready
def ready(bot: GDBot):
    print(f"Bot is ready and logged in as {bot.username}")

# Code to execute when error (WIP idc)
@bot.on_error
def error(bot: GDBot, err: Exception):
    print(f"Err: {err}")

# Code to execute when banned (temporary or permanantly [unused])
@bot.on_banned
def banned(bot: GDBot):
    print(f"Bot has been banned.")

# This loads all commands from the commands folder.
bot.load_commands("commands")

# And if you want to catergorize this:
bot.load_commands("commands/fun")
bot.load_commands("commands/ai")
bot.load_commands("commands/moderation")
bot.load_commands("commands/etc")

bot.run()

and in commands/hello.py:

def hello(bot, comment):
    bot.comment(f"Hello!")

hello.__command__ = "/hello"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

gdbot-1.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file gdbot-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: gdbot-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.8

File hashes

Hashes for gdbot-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98b806bb34dc31a6415fe0744de4f146bc3d96035d4f6a7032b5fa7d1aef4549
MD5 4d8035264fe91f6610dcaf8b27079988
BLAKE2b-256 23ec91f76c6b0fb2dc4b8e0d9787a8882f8fe633e32ca4f47e62a3582428ccf3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page