项目作者: Javacord

项目描述 :
An example bot for the Javacord library.
高级语言: Java
项目地址: git://github.com/Javacord/Example-Bot.git
创建时间: 2018-02-27T16:57:28Z
项目社区:https://github.com/Javacord/Example-Bot

开源协议:Apache License 2.0

下载


Javacord Example Bot Javacord Wiki Discord Server

This bot is an example for the Javacord library.

Features

The bot currently supports the following commands:

  • !copyAvatar
    Sets the avatar of the bot to the avatar of the user who used this command. This command can only be used by the creator of the bot.
    You can find the implementation here: CopyAvatarCommand.java
  • !userInfo
    Shows some basic information (id, name, etc.) about the user who used this command. You can find the implementation here: UserInfoCommand.java

Running the bot for testing

To run the bot right from Gradle (just for testing, not for production) you can do gradlew run --args your-bot-token-here.
You can view the login process by looking at the
Main.java
class.

Building the bot for production

To get a distributable package you run gradlew distZip. The created zip is located at build/distributions/examplebot-1.0.0.zip and contains all necessary things to run the bot, except the token.
Take a look at the build.gradle.kts file.

Running the bot for production

After you built the distributable package as described in the previous section, you can copy over the zip file to where you want to run your bot. There you unzip it whereever you like and run one of the included start scripts.

  1. unzip examplebot-1.0.0.zip
  2. cd examplebot-1.0.0
  3. bin/examplebot your-bot-token-here

The log file will be created in a log directory where you execute the last command.