A simple Bot chat messenger using personal account. Made by NTKhang.
Tutorial has been uploaded on YouTube
Summary instructions:
new event
(message, reaction, new user join, user leave chat box,...) the bot will emit an event to the handlerEvents
.handlerEvents
will handle the event and execute the command:
onStart
:
call a command or not
.user banned
or mode admin box only is turned on
or not, if not, it will execute the command.permission
of the user.countdown
of command is over or not.log
information to the console.onChat
:
when the user sends a message
.permission
of the user.execute
the command, if it return a function
or async function
then it willl check user banned
or mode admin box only is turned on
or not, if not, it will call the function and log
information to the console.onFirstChat
:
when get the first message
from the chat box since the bot started.onChat
.onReaction
:
reacts
to a message has messageID
is set in GoatBot.onReaction
as follows:
/ example:
lobal.GoatBot.onReaction.set(msg.messageID, {
messageID: msg.messageID,
commandName,
// ... and more
);
delete
, if this method is called, it will delete the message from the set.permission
of the user and execute
if the user has permission and log
information to the console.onReply
:
replies
to a message has messageID
is set in GoatBot.onReply
as follows:
/ example:
lobal.GoatBot.onReply.set(msg.messageID, {
messageID: msg.messageID,
commandName,
// ... and more
);
delete
, if this method is called, it will delete the message from the set.permission
of the user and execute
if the user has permission and log
information to the console.onEvent
:
when the user has a new event
type event
(new user join, user leave chat box, change admin box,...)
/ example:
lobal.GoatBot.onEvent.set(msg.messageID, {
messageID: msg.messageID,
commandName,
// ... and more
);
onEvent
and get the command determined by the key commandName
and execute the onEvent
in that command.function
or async function
then it will call the function and log
information to the console.handlerEvent
:
when the user has a new event
type event
(new user join, user leave chat box, change admin box,...)GoatBot.eventCommands
(scripts placed in the scripts/events
folder)eventCommands
and run the onStart
in that command.function
or async function
then it will call the function and log
information to the console.Watch
button in the upper right corner of the screen and select Custom
and select Pull requests
and Releases
and click Apply
to get notified when there is a new update.Tutorial has been uploaded on YouTube
If you have major coding issues with this bot, please join and ask for help.
Currently, the bot supports 2 languages:
en: English
vi: Vietnamese
Change language in config.json
file
You can customize the language in the folder languages/
, languages/cmds/
and languages/events/
1. Enable Google Drive API: Tutorial
2. Add uri https://developers.google.com/oauthplayground (not https://developers.google.com/oauthplayground/) to Authorized redirect URIs in OAuth consent screen: Tutorial
3. Choose https://www.googleapis.com/auth/drive and https://mail.google.com/ in OAuth 2.0 Playground: Tutorial
1. Go to https://www.google.com/recaptcha/admin
2. Add domain repl.co (not repl.com) to Domains in reCAPTCHA v2 Tutorial
- If you don't publish the project in google console, the refresh token will expire after 1 week and you need to get it back. Tuatorial
- Check if you have entered your google project client_id correctly Tuatorial
- If you don't publish the project in google console only the approved accounts added to the project can use it Tuatorial
VIETNAMESE
ENGLISH