A heraldry-related bot, designed for the Heraldry Community.

Overview

Heraldtron mascot

Heraldtron

A heraldry-related bot, designed for the Heraldry Community.

Requirements

cchardet and aiodns are also recommended to improve performance.

For convenience, these can all be installed with pip install -r requirements/main.txt.

Setup

As one may expect, this bot requires a bot account to run. Refer to the discord.py instructions on creating one for more information.

For some functionality, a Google Cloud Platform account is required, with the Custom Search and Google Drive APIs enabled. Custom search features additionally require a Programmable Search engine, since Google has discontinued general search APIs. This must have image search enabled, and it is strongly recommended that you enable the "Search the entire web" setting.

Before running, the bot requires an config.json file in the root directory containing data that it needs to run:

  • DISCORD_TOKEN: The Discord Developer API token.
  • GCS_TOKEN: The Google Cloud Platform API key. Custom Search and Google Drive must be enabled for this key.

This is adequate for most use cases, but for a few commands, additional information is required:

Additionally, there are a number of optional settings that can be specified:

  • USE_JISHAKU: If true, load the jishaku debugger (must be installed separately).
  • OWNER_ONLY: If true, disable usage of the bot for members that are not the owner.
  • LOG_LEVEL: The numeric logging level for the bot. Defaults to 20 (INFO).
  • DB_PATH: An alternate path for the SQLite file to use, instead of the default data/db/heraldtron.db.

Usage

Once your bot is set up, use the standard Python package initialisation method (of course, use python3 if there is an overlapping python2 install):

cd path/to/heraldtron
python -m ht

Run the !help command for information about the bot's functionality.

You might also like...
Discord bot developed by Delhi University Student Community!

DUSC-Bot Discord bot developed by Delhi University Student Community! Libraries Used Pycord - Documentation Features Can purge messages in bulk Drop-D

Opasium AI was specifically designed for the Opasium Games discord only. It is a bot that covers the basic functions of any other bot.

OpasiumAI Opasium AI was specifically designed for the Opasium Games discord only. It is a bot that covers the basic functions of any other bot. Insta

Automate TikTok follower bot, like bot, share bot, view bot and more using selenium
Automate TikTok follower bot, like bot, share bot, view bot and more using selenium

Zefoy TikTok Automator Automate TikTok follower bot, like bot, share bot, view bot and more using selenium. Click here to report bugs. Usage Download

The Official Twilio SendGrid Led, Community Driven Python API Library
The Official Twilio SendGrid Led, Community Driven Python API Library

The default branch name for this repository has been changed to main as of 07/27/2020. This library allows you to quickly and easily use the SendGrid

A Python library for miHoYo bbs and HoYoLAB Community

A Python library for miHoYo bbs and HoYoLAB Community. genshin 原神签到小助手

Python client for numerbay.ai - the Numerai community marketplace

NumerBay Python API Programmatic interaction with numerbay.ai - the Numerai community marketplace. If you encounter a problem or have suggestions, fee

nuub-bot is a multi-purpose designed and developed in python3
nuub-bot is a multi-purpose designed and developed in python3

nuub-bot About Nuub-Bot is an open source, fully customizable Discord bot that is constantly growing. You can invite it to your Discord server using t

A multipurpose bot designed to make Discord better for everyone, written in Python.
A multipurpose bot designed to make Discord better for everyone, written in Python.

Hadum A multipurpose bot that makes Discord better for everyone Features A Fully Functional Moderation component: manage your staff, members and permi

SquireBot is a Discord bot designed to run and manage tournaments entirely within a Discord.

Overview SquireBot is a Discord bot designed to run and manage tournaments entirely within a Discord. The current intended usecase is Magic: the Gathe

Comments
  • Please add Heraldicon integration

    Please add Heraldicon integration

    I've added an API now that should work for Heraldtron integration. I'll happily try to add code myself, but I haven't fully grokked how it works yet, so I thought I'd just document the API as a first step. And perhaps you have certain requirements that could be sorted out here as well.

    General

    Site: https://heraldicon.org API endpoint: https://2f1yb829vl.execute-api.eu-central-1.amazonaws.com/api Data format:

    • I've added JSON support, to avoid the dependency below, all my examples will use JSON
      • required HTTP headers:
        • Content-Type: application/json
        • Accept: application/json
    • natively I use edn, which can be read and generated in Python via edn-format

    API Functions

    generate-from-blazon

    POST Payload:

    {
      "call": "generate-from-blazon", 
      "data": {
        "blazon": "or, a lion azure langued gules"
      }
    }
    

    Success response:

    {
      "success": {
        "blazon": "or, a lion azure langued gules",
        "edit-url": "https://heraldicon.org/arms/new?base=905feefa44",
        "png-url": "https://data.heraldicon.org/blazonry-api/png/115905edf022a1c7fd4a1fa06937c6008198a817.png"
      }
    }
    

    Example:

    curl -H "Content-Type: application/json" -H 'Accept: application/json' https://2f1yb829vl.execute-api.eu-central-1.amazonaws.com/api --data '{"call": "generate-from-blazon", "data": {"blazon": "or, a lion azure langued gules"}}'
    

    The png-url is the rendered arms and edit-url leads to the site to work on the arms with the parsed data already preloaded.

    Error handling

    If there's an error, then the response will have a HTTP status code of 400 (or 500 for internal server error) and the payload should look like this, e.g. for invalid JSON data:

    {
      "error": {
        "message": "Invalid JSON data.",
        "type":"client-invalid-json-data"
      }
    }
    

    If there's an error during the parsing of the blazon, then additional data is provided. In this example "langued" is spelled "langed", the index points to the beginning of the word that wasn't understood (langed) and auto-complete -> choices contains a list of [suggestion, suggestion-type] of words that the parser would've expected. The list is ordered by how well the suggestion fits and the type. In this example langued ends up on top. error usually will be null, unless there's an unexpected error... this probably can be ignored. I thought the auto-complete choices could be presented in some clever way as well, perhaps only the first few, if the list is too long and can't be hidden somehow.

    {
      "error": {
        "message": "Parser error",
        "type": "client-blazonry-parser-error",
        "data": {
          "value": "or, a lion azure langed gules",
          "error": null,
          "index": 17
          "auto-complete": {
            "choices": [
              ["langued", "extra tincture"],
              ["label", "ordinary"],
              ["labels", "ordinary"],
              ["leaved", "extra tincture"],
              ["legged", "extra tincture"],
              ["lion", "charge"],
              ["lions", "charge"],
              ["lozenge", "charge"],
              ["lozenges", "charge"],
              // ...
            ]
          }
        }
      }
    }
    

    Additional options

    Additional options can be passed with a list of keywords under the key options:

    {
      "call": "generate-from-blazon",
      "data": {
        "blazon": "or, a lion azure langued gules",
        "options": [":swiss", ":squiggly", ":wikipedia-france"]
      }
    }
    

    These are just a bunch of special names, but they must be prefixed with a colon. Strings that are not recognized are simply ignored. A list of supported options can be queried programmatically with the next API function, and I think that would be a useful feature for users as well.

    blazon-options

    Payload:

    {
      "call": "blazon-options"
    }
    

    Response:

    {
      "success": {
        "options": {
          "escutcheon": [
            "english", "flag", "french-modern", "heater", "kite", "lozenge", "none", "norman",
            "norman-rounded", "oval", "polish", "polish-19th-century", "rectangle", "renaissance",
            "roundel", "square-czech", "square-french", "square-iberian", "swiss", "wedge"
          ],
          "mode": ["colours", "hatching"],
          "miscellaneous": ["outline", "shiny", "squiggly"],
          "theme": [
            "all", "community-cmwhyk", "community-content-cranium", "community-cotton-candy",
            "community-crystal-gems", "community-home-world", "community-jewelicious", "community-main-seven",
            "community-mother-earth", "community-pastell-puffs", "community-pretty-soldier", "community-rainbow-groom",
            "community-sodacan", "community-the-monet-maker", "community-van-goes-vroem", "ral-traffic",
            "wappenwiki", "web", "wikipedia-bajuvarian", "wikipedia-brandenburg", "wikipedia-default",
            "wikipedia-france", "wikipedia-hungary", "wikipedia-spain", "wikipedia-sweden", "wikipedia-switzerland",
            "wikipedia-web", "wikipedia-wurttemberg"
          ],
          "texture": [
            "cloth-rough", "cloth-smooth", "felt", "glass-frosted", "marble", "metal-brushed-1",
            "metal-brushed-2", "metal-rough", "metal-scraped", "metal-smooth", "mosaic", "none",
            "satin", "stone", "stone-rough", "wood"
          ]
        }
      }
    }
    
    enhancement 
    opened by or 4
  • Add Heraldicon integration

    Add Heraldicon integration

    For https://github.com/mirnovov/heraldtron/issues/1

    Apologies for the noise, I noticed there was a lot of trailing whitespace, I thought it prudent to get that out of the way to avoid conflicts or noise in later commits.

    Also noticed a trailing comma in the schema.

    The final commit should be easier to review on its own, tho.

    opened by or 3
  • Change options prefix to plus

    Change options prefix to plus

    Prefer '+' as prefix for Heraldicon parser options

    Both are accepted, so users preferring them or already being used to them can still use them. But + interferes less with Discord, which starts suggesting emojis when a user types :.

    opened by or 0
Owner
null
WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community

WallAlley.bot About WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community. All data a

Mohammad KHADDAN 1 Jan 22, 2022
Local community telegram bot

Бот на районе Телеграм-бот для поиска адресов и заведений в вашем районе города или в небольшом городке. Требует недели прогулок по району д

Ilya Zverev 32 Jan 19, 2022
Robocord is a bot created for the Pycord community.

Robocord is a bot created for the community of the Pycord Server. Just a bot created for Pycord Server. You can start pull requests, I will check it and if its good I will add it to the bot. ??

Bruce 7 Jun 26, 2022
Community-based extensions for the python-telegram-bot library.

Community-based extensions for the python-telegram-bot library. Table of contents Introduction Installing Getting help Contributing License Introducti

null 74 Dec 24, 2022
A community Billy vs SNAKEMAN bot

BvS Bot A discord bot built for the Billy vs SNAKEMAN community! Dependencies An installation of Python 3.9.x with ssl compiled. The following pip pac

Neopolitan 2 May 10, 2022
A discord bot made by the community (uses python)

discord community bot context: this is a discord bot made by the community by community i mean people adding commands to the bot or changing the bot b

TR ASH 0 Oct 11, 2022
The Python version of the official Discord bot for the Astura Studios Discord community server.

About Astura (Python version) is the official Discord bot for the Astura Studios Discord community server developed and maintained by Ascendus and the

Ascendus 1 Apr 21, 2022
A community made discord bot coded in Python and running on AWS.

Pogbot Project Open Group Discord This is an open source community ran project. Join the discord for more information on how to participate. Coded in

Project Open Group 2 Jul 27, 2022
🤖 A discord bot for Dota2 community

BOTA BOT-A is a free Discord Dota 2 bot which provides comprehensive Information of every Dota 2 characters and exciting features for the community. P

Bendang 23 Jun 29, 2022
Simple Discord bot for the Collectez community.

Harvey - Discord Bot Simple Discord bot for the Collectez community. Features Ping the current status of Collectez's Teztools node. Steal emojis from

delintkhaum 1 Dec 26, 2021