Giter VIP home page Giter VIP logo

idleapi.tio's Introduction

idleAPI.tio

A discord bot that interacts with the Travitia API, specifically the IdleRPG portion.
This bot is intended for selhosting, and as a demonstration what the API is capable of.

Installing

Prerequisites

To install this code, you need to make sure you need the following prerequisites:

Python is used for interpreting the code so everything runs as it should. Without Python, you cannot run this bot.
PostgreSQL is the database management system. It's used to store data, namely protected items.
Redis is an in-memory dictionary-like storage system. It's used to store cooldowns.

Beside these prerequisites, you need to install some Python packages using pip. The list of required packages can be found in this file.

Configuration

Before this bot can work, you need to enter several config values. You can do so by renaming config-example.py to config.py and filling in the fields.
Here is a brief explanation on what these are used for:

  • command_prefix: This is the prefix used for bot commands. Entering "< " will result in commands being run like < ping. This can be any string, or a list of strings.
  • token: Your bot application's token. This is used to connect your bot to discord. You can find it on the Discord developer page of your application. Navigate to "Bot" on the left side, and a button to copy the token should appear. NEVER SHARE THIS WITH ANYONE!
  • api_token: The access token provided to you by Travitia. This is used for authorizing requests to the API. Without it, all requests will return an error 403. You can receive one on their Discord server.
  • postgres_login: Your database credentials used to connect to your database. Without them, you cannot store item data.
    • database: The name of the database you want to use.
    • user: The username/role name of the user you want to connect as.
    • password: The password you gave said user/role.
    • host: The host address. In most cases, this will be 127.0.0.1, meaning the database is on your local system.
  • bans: A list of user IDs that should not be able to access the bot. If a user's ID is in this list, commands they use will be ignored.

Beside the configuration, there is additional config in the context class. Update the emoji IDs in order to allow the use

Running the bot

If everything is set up correctly, you can use python3 ./main.py to run the bot. In case of errors, check the created error.log. If that doesn't help, do not be afraid to contact me.

idleapi.tio's People

Watchers

 avatar

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.