Giter VIP home page Giter VIP logo

railway-d4j-template's Introduction

Railway Discord4J (Maven / Spring) Template

This is a template for deploying Discord4J bots on Railway. It is based on the example Maven / Spring project from the example repository

Deploy on Railway

There are, also a few differences:

  • Java version 17
  • Discord4J version 3.2.3
  • Built-in guild command support
  • Environment variables supported through .env

Guild commands

In order to add a guild command, you can add a folder to src/main/resources/commands/guild/, which must be named with the ID of the guild you wish to register commands for. Inside that folder, you can put normal command.json files.

Setting up .env

It's quite normal to have a .env file in your project with all the environment variables that matter only for this project, so you can test locally. I've done most of the work for you. you can simply create a file (called .env) and place it in the root folder of your project (next to Dockerfile and pom.xml). You can then reference this variable in application.properties like a real environment variable, and reference the application.properties variable inside your code using the @Value-annotiation. You can find an example of this inside the Bot class.

Never commit the .env file to git!

More Help

You can find more help with using Discord4J and building Discord bots at the following resources:

Additionally, you can find help with using Railway at the following resources:

railway-d4j-template's People

Contributors

lelebees avatar

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.