A discord bot for the Moonland server.
- Create a virtual environment and activate it.
>>> "python3 -m pip install virtualenv >>> virtualenv venv >>> source ./venv/bin/activate"
- Install pip packages
pip install -r requirements.txt
- Create a file named
.env
and save the token in the file asTOKEN=BOT_TOKEN_ID
- Set up google services
-
Create a new project named anything (Eg: Moonland Lunar Bot) https://console.developers.google.com/apis/
-
Search and enable google drive api service and google sheets api service
-
Create a new service account and share me your service email https://console.developers.google.com/apis/credentials
-
Add a new key for your service account and download the services.json file and move it to the bot's directory or
.configs/gspread/
directory. -
Create a google sheets, and the service email as an editor.
-
- Run the
bot.py
filepython bot.py
-
On new member join : When a new member joins, a row with its username, userid, coins, cash and email is added in
./csv/users.csv
file. -
>wallet : If the user has joined the server, when the user direct messages the bot with
/wallet
. The bot replies with the following message.
- >link : If the user direct messages the command
/link
, following messages are replied.
-
>send_message : Use this command to send message as a bot, on one of your servers text channels. (not DM). Create a private #bot-commands, and use it specifically for this command.
/send_message #text-channel <Your message>
- >edit_message: Use this command to edit the message of bot, on one of your servers text channels. (not DM). Create a private #bot-commands, and use it specifically for this command.
Right click on any of bot's message and copy its message id. If copy id is not available, enable develop mode from settings.
```
/edit_message messageid
<Your message>
```
@IsharMhzn