Coder Social home page Coder Social logo

efreak / ai_horde_discord Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zeldafan0225/ai_horde_discord

0.0 0.0 0.0 497 KB

A discord bot to interact with https://stablehorde.net

License: GNU Affero General Public License v3.0

JavaScript 0.04% TypeScript 99.96%

ai_horde_discord's Introduction

AI_Horde_Discord

A basic Discord bot to generate images using the AI Horde API.

DISCLAIMER: THIS REPOSITORY IS IN NO WAY ASSOCIATED TO THE CREATORS OF AI HORDE
OFFERING THIS CODE IN FORM OF A PUBLIC DISCORD BOT WHICH CAN BE INVITED BY EVERYBODY IS NOT SUPPORTED.
THE SCALE OF A BOT USING THIS CODE IS 1 SERVER, EVERYTHING ABOVE IS NOT SUPPORTED.

Features

View the changelog to see what has been added

This package includes the code for a discord bot which interacts with the ai horde api. The bot has the following features:

  • /generate command with all options the api supports at the time of creating this file
  • /login, /logout and /updatetoken for users to add and manage their account which they can create at https://aihorde.net/register
  • /userinfo (Userinfo context command) which shows your ai horde user information and the user information of anybody else who is logged in
  • /terms which shows how the bot currently handles the api token and further information
  • /models which shows all currently available models
  • /worker which lets you see information on an active worker
  • /team which lets you see information on a team
  • /news which shows latest news about the horde
  • /transferkudos (Transfer Kudos context command) to send somebody kudos
  • /interrogate to interrogate any image
  • /party to start a generation party with a given style
  • "Remix" to edit another discord users avatar
  • "Caption" to caption anozher discord users avatar
  • advanced configuration file which lets you change how the bot behaves and what actions the user can use (for limits refer to https://aihorde.net/api)
  • logging prompts, user id and generation id to track generation of malicious, nsfw or illegal content
  • and even more...

Version Requirements

  • NodeJS >= 18.0.0

Optional:

  • PostgreSQL >= 14.6

How to set up

A detailed Linux setup can be found here

  1. download the code from this repository
  2. get the token of your discord bot (https://discord.com/developers/docs/reference#authentication)
  3. Install the node modules using npm i (make sure the dev dependencies are also installed for typescript to work)
  4. remove the template. from the template.config.json file

If you want to have extra functionality do the following steps:

  1. set up a postgres database
  2. fill out the template.env and rename it to .env

If you just want to generate images with no token or the default token in the config.json file do the following steps:

  1. modify the config file and set use_database to false

  2. fill out the template.env and rename it to .env (you can leave the keys prefixed with DB_ empty)

  3. Run npm run generate-key and copy the generated encryption key in your .env (If you disabled token encryption you can leave it blank)

  4. modify the config.json file (from step 4) to fit your needs (you can read about what which property does in config.md)

  5. compile the code and start the process (this can be done by using npm run deploy)

Now if everything is set up it should start and give an output in the console.

Encryption Key

When changing your encryption key after deployment the tokens won't be decrypted properly.
Avoid changing the encryption key after initial setup. Disabling encryption at any point will make commands for users who saved their tokens in an encrypted form not work any more.

How to update

  1. Pull the code from this repository
  2. Update your config. Reading through the changelog might help.

ai_horde_discord's People

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.