-
Notifications
You must be signed in to change notification settings - Fork 1
Creating a Google API Token and User, and setting up a spreadsheet
Navigate to google sheets, and click the new blank spreadsheet button. Make sure to label the A row in accordance with the way the bot outputs data. The bot outputs data starting with the B row, in the order:
- ID of the message author
- Username and tag of the message author
- Message content
- Message time (in UTC)
- Message ID
- Jump link to the message
- The channel the message was sent in The bot will send each new message in the B row, and push all of the other messages down
Create a new worksheet, and title it "Sheet2" Make sure the first sheet is named "Sheet1" Note: a worksheet is different from a spreadsheet. To create a new worksheet, press the button at the bottom left of the screen
Note: If you'd like to skip this step, just press enter when it asks you for a graph URL in setup.exe. The program is functional without it
On Sheet2, label A1 "Date" and "A2" number of messages. You can customize the graph however you'd like, when you're done, click on your graph, then click on the three dots to open the graph menu. Select "Publish chart" and choose the "Link" option.
Once selected, click the drop down menu directly under the text "Link", and select only the title of your graph. Do the exact same thing under "Published content and settings." This is to protect you and your user's privacy. As shown in the image above, by default the option on-screen directly under the text "Embed" will say "Interactive". Change this to "Image". On the bottom, make sure the link is set to "Automatically republish when changes are made". Once all of this is done, copy the URL linking to your graph and save it somewhere. You'll need it for setup.exe/setup.py.
First go to the Google API Developer's Console. Create a new project and name it whatever you'd like. Click the "Enable APIs and Services" button and search for Google Drive. Enable the Google Drive API.
Press the back button in your browser until you're back to your project's dashboard, and then choose the credentials button. Press "Create Credentials" and then "Service Account". Name the service account and give it whatever permissions you'd like, provided it will have edit permissions with the role you choose. If you can't decide, choose "Editor". Then, name the email for the bot. It doesn't matter what this is. After the bot account is setup, download it's credentials as a JSON file. Rename this JSON file "credentials.json" and add it to the same directory as the release of Cherub you're using.
IMPORTANT: Google will NOT give you another copy of your credentials file, so PLEASE store it carefully. When downloading a new version of Cherub, be sure to add this file to Cherub's directory BEFORE deleting the old one.
Share the sheet you created in the "Setting up a spreadsheet" section of this guide with the Service Account. To do this, open the spreadsheet and click "share" and then type in or paste your Service Account's email.