Hayame - Another Discord bot, so some info about the content

Related tags

Miscellaneous Hayame
Overview

Hayame

Yeah, here we go again!

Another Discord bot, so some info about the content.

Invite the bot

You want to invite the bot? Unfortunately, it’s rarely online. If you are interested, send me a DM, and I’ll host it somewhere for you. But for now, it’s going to be offline 80% of the time.

Set-up

Config

The bot needs a config file with some info, like the Discord token. The template can be found here. During the rest of our set-up, we will populate this with some values.

At the moment of writing, you can already get a Discord token from the developer portal. Create an application, go to the bot settings, insert the token found there.

Prometheus

Prometheus is software for statistics, this (at the moment of writing) is required for the bot. See the installation guide by Prometheus. After you did that, replace the prometheus config with this config. Replace PROMETHEUS-SERVER-BOT-PORT with the port the bots prometheus server runs on. This also has to be set in the bots config, named prometheus_bot_port.

Grafana

Grafana is software for displaying the statistics, with a lot better UX/UI than Prometheus. Grafana can be installed from their site, when using the default port, it’s already set in the config. Now you still need a key for the API, this way our bot can generate the dashboard/datasource.

Picture of the Grafana menu

Go to configuration → API Keys.
From this screen, go to "Add API KEY".
Here, set the name to whatever you want. After this, set the role to Admin, and the time to live to however long you want to (recommend above 1 month).

On start-up, the bot will now take care of everything for you!

Maria-DB

Install MariaDB using https://mariadb.org/download/?t=mariadb&p=mariadb&r=10.6.7, please use version 10.6.7

During installation, you need to set a username and password and port, these have to be set in the bots config.

Now everytime your bot starts up, your DB will get updates (new tables, or old tables will get edited).

Credits

My bot examples come mainly from my own development, still credits to Bean for the idea of adding statistics using Promethues and Grafana. And thanks to TJ-Bot for the idea of using Flyway.

Comments
  • Migrate Flyway to Gradle

    Migrate Flyway to Gradle

    This allows easier database migration, no code changes need to be done when migrating, one can just run the migrate command, or possible one of the others.

    Currently migration happens, if something goes wrong, the user has to manually add code to the bot, that clears the DB or something alike. This is horrible developer experience

    enhancement bot/system management 
    opened by Tais993 1
  • Implement Grafana dashboard generation

    Implement Grafana dashboard generation

    Motivation

    Currently, the user manually has to create a lot of dashboards/panels. This is a very time-consuming task, and especially when you want metrics with more labels, this is going to take a lot of time. By generating these panels on creation, no manual work will need to be done, improving UX drastically.

    Implementation

    Creation of limited simple Grafana api wrapper, where all calls are blocking to make it really simplistic. Using jackson automatic JSON serialization/deserliazation.

    Info

    See the documentation of the Grafana API

    enhancement blocked bot/system management 
    opened by Tais993 1
  • Implement Prometheus command specific statistics

    Implement Prometheus command specific statistics

    See #1

    Motivation

    Statistics are fun and interesting, an undeniable fact.

    Implementation

    Unlike #1, this is there to implement statistics about specific commands. How long a specific command takes to run, and how often it gets run. To implement this, I need commands to know how I'll exactly implement this. Therefor it's blocked till commands have been added.

    Info

    See the Java client, or their website

    enhancement bot/system management 
    opened by Tais993 1
  • Implement Prometheus

    Implement Prometheus

    Prometheus is software for displaying metrics on your application.

    Motivation

    Statistics are fun and interesting, an undeniable fact.

    Implementation

    For now, implement statistics in general. Things like ram usage, how often commands get ran and such. This also includes how long the checks before the command take, and how often interactions run. This isn't yet command specific, but globally.

    Command specific statistics

    This is for statistics for how often each indivual command gets run, and how long they indiviually take. See #2 for more info

    Info

    See the Java client, or their website

    enhancement bot/system management 
    opened by Tais993 1
  • Add replace to IDatabase

    Add replace to IDatabase

    Adding an insert that inserts or replaces is kinda sketchy since the name suggests otherwise. Adding a dedicated replace method makes it clear what actually happens, and causes behaviour to be equal and expected over the different implementations.

    enhancement 
    opened by Tais993 0
  • Database rework

    Database rework

    Reworks the before-hand really trashy DB system.

    After this rework it's been improved a lot, but still isn't optimal.

    This rework adds an universal interface (IDatabase and IStringDatabase) which adds common methods.

    And this rework also adds AbstractDatabase which works against duplicated code, and bloated code by adding helper methods.

    From now on, Database will also have all the other Databases, they shouldn't (and can't) be made anymore using their constructor.

    enhancement 
    opened by Tais993 0
  • Added tests to some methods

    Added tests to some methods

    While this by far isn't enough, tests are a long lasting process, they'll be added over time. And for new PR's and commits, a quick look will be made to check or "test" are realistic, if yes, they will be added in that (or the following) commit.

    Closes #23

    enhancement bot/system management Testing 
    opened by Tais993 0
  • Discord Client Action

    Discord Client Action

    This PR implements DiscordClientAction which adds easier support for running "actions" / opening "pages" within the Discord client.

    See https://github.com/Together-Java/TJ-Bot/pull/391 for more info

    opened by Tais993 0
  • Testing

    Testing

    Currently nothing is being tested by unit or integration tests, this means that errors may constantly happen when changes are being made to the system.

    Tests would be beneficial to maintain quality, so 🔜

    enhancement 
    opened by Tais993 0
  • Implement logging

    Implement logging

    Currently a log of things aren't logged, we need to implement a logging (logback?) to show the information. This also allows us to set a custom pattern for better logging

    enhancement bot/system management 
    opened by Tais993 0
  • Add user profiles

    Add user profiles

    User profiles

    This aims to add:

    The ability to create & edit your own user profile.

    This functions using:

    Modals & buttons, exact design is uncertain as of right now

    The command's signature:

    /profile [view/edit] (....)
    

    or

    Profile design:

    image

    Personal info is a custom field

    Socials will be a non-custom field

    enhancement discord-command user-UX/UI 
    opened by Tais993 0
  • Move to columnLabel from columnIndex

    Move to columnLabel from columnIndex

    Currently, in the code columnIndex is mainly being used.

    This is fine, but the moment an column gets added, it has to be added to the end. This isn't always nice, and can cause weird tables.

    Instead, columnLabel's should be used, that way the order doesn't matter and it can stay a logical order after updates.

    This change only applies to ResultSet's, PreparedStatement's don't offer the functionality to use labels.

    enhancement 
    opened by Tais993 0
  • Only create datasource if it doesn't exist already

    Only create datasource if it doesn't exist already

    Currently the datasource get's created at all times, this isn't required. If it already exists, not creating it would most likely be more effective and less error-prone.

    enhancement bot/system management 
    opened by Tais993 0
  • Relook documentation

    Relook documentation

    Some classes and methods have been added, which don't have documentation. While it's fine, nothing is wrong with adding documentation to possibly improve experience when maintaing in the far-fetched future.

    documentation 
    opened by Tais993 0
Owner
Tais993
This is me, me is me.
Tais993
Discord bot for 2b au, nothing useful yet lol

2bot2australia a bot for 2b2t australia :) Commands 2bau.player give you info of the player (only works when the player is on the server) 2bau.info gi

noat 4 Mar 17, 2022
lobster is an easy-to-use Discord bot to play music in any voice channel

lobster is an easy-to-use Discord bot to play music in any voice channel

lundy 6 Apr 8, 2022
Core part of pipes framework plus some commonly used extensions

Pipes Pipes is a simple, lightweight data processing framework for Java. This repo comes with the core part plus three extensions (For Google Big Quer

null 7 Oct 4, 2022
This service checks the Co-WIN public API at a specific interval and send update to users specified telegram bot.

COVID VACCINE TELEGRAM BOT USING SPRING BOOT This application is a covid vaccine slot notifier via telegram bot. This application uses public CO-WIN A

Hardeek Sharma 6 Oct 4, 2022
A Java Telegram bot that provides thirukkural in tamil, english translations with all information!

A Java Telegram bot that provides thirukkural in tamil, english translations with all information!

VINU 5 Oct 19, 2022
Jiskord is a selfbot wrapper for Discord with almost every API endpoint accessible

Jiskord Jiskord is a selfbot wrapper for Discord with almost every API endpoint accessible. This library is inspired by Discum. It is made using Java

Vinesh Rajpurohit 5 Feb 28, 2022
Discord IPC - Pure Java 16 library

Pure Java 16 library for interacting with locally running Discord instance without the use of JNI.

Meteor Development 8 Nov 14, 2022
By this package we can get sim info, call logs and sms logs.Also we can find for specific sim info and call logs as well.

sim_sms_call_info A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package

 Hasib Akon 3 Sep 17, 2022
Some anti afk bot which prevents you from getting punished for going afk in games. Way of stopping the bot is slightly flawed but we'll ignore that.

AntiAFK Some anti afk bot which prevents you from getting punished for going afk in games. Gui mode coming soon... Installation Install Java 17. Downl

flasky 1 Jan 13, 2022
This is some Discord bot I made to help me learn Java. Not very useful yet.

JennyChan This is some Discord bot I made to help me learn Java. Not very useful yet. What it can do so far: Reply to mention List commands Show bot u

null 0 Sep 1, 2022
Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.

Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.

null 1.5k Jan 4, 2023
You are missed at island with another 23 solider, loot chests and fight another opponents to survive, last man stands will win.

SurvivalGames The best SurvivalGames project at the market Wiki • Report issue • Request feature About This Project For years ago, a lot of players wa

ID2R Studios 10 Sep 8, 2022
A completely free Discord music bot that is easy for anyone to set up and run on their machine.

PortableAudioBot A Music Discord bot designed to be portable and easy for anyone to setup and run on their machine. Project is still in early access,

madey 3 Oct 1, 2022
A simple music player bot for Discord in Java

Delete Discord A simple music player bot for Discord in Java Usage Let's start by running the .jar

Fenix 2 Sep 30, 2021
A recreation of Discord's Trick'ord Treat bot!

TrickordTreat A recreation of Discord's Trick'ord Treat bot! Don't feel like setting up the bot? Use our publicly hosted version: https://discord.com/

Scar <3 4 Nov 29, 2022
Discord bot for 2b au, nothing useful yet lol

2bot2australia a bot for 2b2t australia :) Commands 2bau.player give you info of the player (only works when the player is on the server) 2bau.info gi

noat 4 Mar 17, 2022
A public bot for Discord servers 🥶

Public sample bot for Discord servers ?? Bot is written in Java 16, currently there is only verification in the bot, but if someone knows at least the

Kacper 8 Jul 7, 2022
An open source Discord Bot made in Java!

ShiShi An open source Java Discord bot Report Bug . Request Feature About The Project This is a open source Java discord bot making use of the JDA lib

kb 2 Aug 5, 2022
A simple Discord bot, which shows the server status of the Lost Ark server Beatrice

Beatrice A simple Discord bot, which shows the server status of the Lost Ark server Beatrice. Example Usage Clone the repository. Edit the property fi

Leon 3 Mar 9, 2022
A useful Discord Bot for you!

kottbot A useful Discord Bot for you! Installation Download the build. Put it on your local or root server Execute this command to start the Bot: java

Jannis Wollschläger 1 Jan 24, 2022