Skip to main content

A library for making a bot in Destiny.gg chat.

Project description

PyPI version info PyPI supported Python versions

A library for making a bot in Destiny.gg chat.

Installing

Python 3.8 or higher is required

# Linux/macOS
python3 -m pip install -U dgg-bot

# Windows
py -3 -m pip install -U dgg-bot

Usage

Not sure what to put here at this point in time. Unauthorized chat bots are subject to being banned, ask Cake in DGG for permission and guidelines for chat bots before running one.

Examples

A simple bot with two commands and will yump back at chatters.

from dggbot import DGGBot
import time

bot = DGGBot("AUTH_TOKEN", username="Username", owner="Owner", prefix="$")  # default command prefix is "!"

@bot.command()
@bot.is_owner()  # only the owner named above can use this command.
def test(msg):  # $test
   msg.reply("Test 123")

@bot.command(aliases=["banmeplease"])  # aliases for this command
def banme(msg):  # $banme / $banmeplease
   bot.send("RightToBearArmsLOL BINGQILIN nathanTiny2")

def is_cake(msg):  # a check where only the user Cake can use commands with this check
   return msg.nick == "Cake"

@bot.command(aliases=["oooo"])
@bot.check(is_cake)
def pog(msg):
   msg.reply("Cake OOOO")

"""
Events
You can either name the function after the event, or include the event name in the decorator.
mention() is also included as a shortcut for event("on_mention").

Event names: on_ban, on_broadcast, on_join, on_mention, on_msg, on_mute, on_privmsg, on_quit, on_refresh, on_unban
"""
@bot.event()
def on_msg(msg):
   print(msg)

# @bot.event("on_mention")
@bot.mention()
def yump(msg):
   if "MiyanoHype" in msg.data:
      time.sleep(0.5)
      msg.reply(f"{msg.nick} MiyanoHype")

if __name__ == "__main__":
   while True:
      bot.run()
      time.sleep(2)

Project details


Download files

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

Source Distribution

dgg-bot-0.3.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

dgg_bot-0.3.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file dgg-bot-0.3.1.tar.gz.

File metadata

  • Download URL: dgg-bot-0.3.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for dgg-bot-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3c4e4505d6126592c84094a01c4aaba350451eb433976c632aaed41d3fdfa1db
MD5 fbf5178935e710f5d4a48018ca30bb2a
BLAKE2b-256 8b135adbfdcbb8f098d1825e711550790c0b2903322d0feb0b08b80250e2faaf

See more details on using hashes here.

File details

Details for the file dgg_bot-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: dgg_bot-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for dgg_bot-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fb7447896760ae20b70d9d07113bbb37db50fe115af8e8d9db21866ac8a728b
MD5 05b583ff936c006429047b722c95e359
BLAKE2b-256 890f6c625c0ae232ff8f3b88ac55647cfaa98fe9326ae72012c3fd62024188a5

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