https://github.com/hugonun/discord2sheet-bot
Discord bot that stores messages to Google Sheet.
https://github.com/hugonun/discord2sheet-bot
discord discordpy google-sheets google-sheets-api-v4 hacktoberfest python
Last synced: 9 months ago
JSON representation
Discord bot that stores messages to Google Sheet.
- Host: GitHub
- URL: https://github.com/hugonun/discord2sheet-bot
- Owner: hugonun
- License: bsd-3-clause
- Created: 2019-04-11T16:00:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-22T16:21:08.000Z (about 4 years ago)
- Last Synced: 2025-06-15T02:38:23.831Z (12 months ago)
- Topics: discord, discordpy, google-sheets, google-sheets-api-v4, hacktoberfest, python
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 52
- Watchers: 4
- Forks: 26
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discord2sheet-bot
This bot allows users to submit messages directly to your Google Sheet.
Example:
`!s Hello world, How are you today?`
Output:
Username - UserID - Date - Field 1 - Field 2

## How to set it up
**Step 1:** Enable the API and download credentials.json for desktop app (not web). This can be done here: https://developers.google.com/workspace/guides/create-credentials
Make sure credentials.json is stored in the same directory as the bot.
**Step 2:** Open init.py and change the following values(<>):
SPREADSHEET_ID = <> - The ID of the spreashsheet to store the data. It can be found on the URL once opened.
FIELDS = <> - Amount of fields/cells that get stored. They are on the user's message seperated by comma (!s field1, field2,field 3)
client.run('<>') - The token of the Discord bot.
**Step 3:** Install Python dependencies
If you haven't installed Python yet, download it [here](https://www.python.org/).
Install discordpy: `pip install discord.py`
Run the pip command listed here: https://developers.google.com/sheets/api/quickstart/python#step_2_install_the_google_client_library
**Step 4:** Run the bot
`python init.py`
------
## Additional configutations
REQUIREDROLE = <> - If you want to restrict the command to a specific role, insert here the role id. If not, insert `None`.
RANGE_NAME = <> - Where the data should go in the spreadsheet. Default value is `A1`.
DATA = <> - What data goes to the rows, seperated by `[]`. Example: `DATA = [result[0]] + [''] + [result[1]]`