Skip to content

[DIT22-39] Altered the documentation to include webhook setup and digibot setup #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,45 @@ Two main tools have been written to achieve this:

## Setup

### Discord Server

Webhook, requests channel, archives channel, events category, permissions, role names
### Discord Server Setup for Google Forms to Discord

## Webhook Setup:
For setting up the channels to work with DigiBot:
* Ensure that the Manage Webhooks permission has been enabled in the server required
* Go to Server settings, under Integrations, click on Webhooks and then Create Webhook
* Click on the channel you would like automated responses to be sent to
* Copy the webhook URL
* Copy the drive ID by copying the link on the required google drive folder
https://drive.google.com/drive/folders/{drive_id}?usp=sharing
* Update both the form Google App Script and digisoc.js by changing the constants of webhook URL and drive IDs
* In the code for the file digisoc.js, paste the Webhook URL between the '' symbols on for const webhookURL and driveID
* Ensure the file is saved

For further clarification, refer to https://github.com/axieax/google-forms-to-discord

### DigiBot

Put your Discord bot token in a .env file

This can be found in https://discord.com/applications/{application_id}/bot

### To setup DigiBot on your Discord server:
* Go to the Discord Developer Portal
https://discord.com/developers/applications
* Create a new application and name it accordingly
* Click on Bot to create a bot, copy the bot token (required for local setup)
* Set your bot to have admin permissions, with integer 8
* Select the following Privileged Gateway Intents:
* Server Members Intent, Message Content Intent (enable through GUI)
* Invite the bot to your server by using the URL generator under OAuth2 that will have a similar form to:
`https://discord.com/api/oauth2/authorize?client_id={client_id}}&permissions=8&scope=bot`

### Setting up the Bot locally:
* Copy the ssh key of the automation-suite repository
* On the terminal write:
`code .env`
* Save your Discord bot token in the .env file in the following format:
`TOKEN=DISCORD_BOT_TOKEN`
* To start DigiBot, type the following on the terminal:
`python3 main.py`
For further reading into permissions relating to coded intents on members:
https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members

### Docker Deployment

Expand All @@ -44,3 +72,8 @@ Build image
Create container from image
`docker run digibot-image`
add `-d` flag for daemonised/detached process (in background)

## Ensuring the discord server is compatible with DigiBot
Initial discord server preparation:
* Create a category with a channel called requests and a channel called archives
* Note that the event name index for event name is zero-indexed