A simple discord-bot bases on Repl.it
This project aims to discover how to program a Discord bot by using JavaScript. Because of the firewall issue, the project is loaded on Repl.it. One good reason is, by using Repl.it the environmental problems are minimised. The idea comes from a pythoneer Gareth Dwyer's 'Building a Discord Bot with Python and Repl.it'.
https://www.codementor.io/garethdwyer/building-a-discord-bot-with-python-and-repl-it-miblcwejz
v0.0.1 realised normal message-sending processes. Two nano games(roll dice & flip coin) are provided as well.
- Create a new Repl account, choose "Nodejs" as your language.
- Create a Discord Bot and log it in your Discord serve.
- Change the
TOKEN
in a file:.env
(there is no space beside=
) - The dependencies can be installed automatically after saving
package.json
. If there is nothing happen, you can refresh the whole webpage to reload.discord.js-commando
is used as main dependency so far, rather thendiscord.js
.discord.io
andwinston
can be ignored. - Run the code in Repl.it and make sure your bot is online
- Type
!help
to your bot, you can see instructions and all available commands. - For example, type
!roll
, you will see a dice number as follow ```@Author You got a 4 - The richEmbed message includes URL, online image, local image, title, fields etc.
In the next version, a python program will be connected for proving dynamic data from public websites. Meanwhile, a python version program will be developed which aims to be embedded in a Raspberry Pi to mobilised the server.