Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.
/ DiscordBot_Java Public archive

A barebones Java-based Discord bot example.

License

Notifications You must be signed in to change notification settings

UWB-ACM/DiscordBot_Java

Repository files navigation

DiscordBot_Java

A barebones Java-based Discord bot example written using Discord4J.

For a barbones python-based example, See also CSSBot_Py.

For a full example written in C#, See also CSSBot.

Table of Contents

Installation

This repository utilizes Gradle in order to automate the process of building the environment.

Prerequisites

Setup

Note For a detailed description of how to set up your environment with Gradle (for beginners), please see Setting Up Your Environment.

After cloning and forking the repository, run the following command within the local directory:

gradle build

To build the IntelliJ idea files, run the following command:

gradle idea

Note For more tasks, see also Usage

Setting Up Your Bot

We have designed this barebones example to be quite easy to set up. All you need to do is find out your bot's user token. In order to do that, we must register our bot on discord.

Register Your Discord Bot

  • Navigate to the Discord API docs and login.

  • Click on the "New App" button.

  • Name your app. Click "Create App".

  • Click "Create a Bot User".

  • Locate your bot's user token.

    • Your user token must not be shared with anyone. If it is posted publicly, change it ASAP.
  • Create a new file in your directory: config.properties

  • Add your token to the first line in the file. Example (inside config.properties):

        token=[TOKEN GOES HERE]
    

Usage

All of these commands must be run in the command line (or terminal) in the same directory as the local repository.

To build runnable executables of the bot:

gradle build

To execute the bot:

gradle run

Note If running in Windows, you can stop the Bot from running by performing CTRL + C and then confirming the decision by pressing Y

To clean the repository of the current build:

gradle clean

To create the necessary IntelliJ files:

gradle idea

To clean the IntelliJ files:

gradle cleanIdea

To see all available tasks:

gradle tasks

About

A barebones Java-based Discord bot example.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages