Skip to content

Commit

Permalink
🚀 RELEASE: v0.8.6
Browse files Browse the repository at this point in the history
Merge pull request #55 from thirdweb-dev/dev
  • Loading branch information
warengonzaga authored May 25, 2023
2 parents 65d75ce + 21285e6 commit 1d03015
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 86 deletions.
89 changes: 3 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,5 @@
# thirdweb Support Bot
# Support Bot

A dedicated forum-based support Discord bot for the thirdweb community. This bot is created specifically for the community setup of thirdweb community. If you want to use the bot would recommend to use the [public version](https://github.com/warengonzaga/forum-based-support-discord-bot) of it.
A dedicated self-hosted forum-based support Discord bot for the thirdweb community. Specifically made for the [thirdweb](https://discord.gg/thirdweb) Discord community server.

## 🤔 How to Use

This bot has only one command to use, for auto closing the posts from forum channels.

- Make sure the forum post has tags that is required before posting.
- Add proper permission to the bot to avoid unexpected issues.

### Commands

To close thread using prefix command.

```bash
!close
```

To close the thread and resolved by the username mentioned

```bash
!close @username
```

## 🎛️ Configurations

### Config File

```json
{
"resolution_tag_name": "Solved",
"command_prefix": "!",
"utc_offset": -8,
"datasheet_init": "init",
"datasheet_response": "response",
"datasheet_resolve": "resolve",
"mention_message": "Hello there! If you need help, please read the information in <#1074862134284005396> and post your questions or issues in the <#1029543258822553680> channel. Our team and community members are always ready to help you out. Thank you for building with us!"
}
```

| Config Name | Description |
| --- | --- |
| `resolution_tag_name` | The name of the tag to mark the post resolved. |
| `command_prefix` | A prefix you want to use with `close` command to be recognized by the bot. |
| `utc_offset` | Time and date UTC offset for recording the data. |
| `datasheet_init` | Refers to the sheet name in your google spreadsheet. This should be the first sheet in the order. |
| `datasheet_response` | Refers to the sheet name in your google spreadsheet. This should be the second sheet in the order. |
| `datasheet_resolve` | Refers to the sheet name in your google spreadsheet. This should be the third sheet in the order. |
| `mention_message` | The message bot will send if the bot mentioned by the user, you can use use the channel ids to mention it within the bot message. |

## 👁️ Environment Variables

```env
DISCORD_BOT_TOKEN=<discord_bot_token>
DISCORD_SUPPORT_ROLE_ID=<role_id>,<role_id>
GOOGLE_PRIVATE_KEY=<private_key>
GOOGLE_SERVICE_ACCOUNT_EMAIL=<service_email_account>
GOOGLE_SPREADSHEET_ID=<google_spreadsheet_id>
```

## 💻 Development

### Install the packages

```bash
yarn install
```

### Run the bot

```bash
yarn dev
```

## 📃 License

The Forum-based Support Bot (thirdweb support) is licensed under [GNU General Public License v3](https://opensource.org/licenses/GPL-3.0).

## 📝 Author

The Forum-based Support Bot (thirdweb support) is developed and maintained by **[Waren Gonzaga](https://github.com/warengonzaga)**, with the help of awesome [contributors](https://github.com/warengonzaga/thirdweb-support-discord-bot/graphs/contributors) for the [thirdweb community](https://discord.gg/thirdweb).

[![contributors](https://contrib.rocks/image?repo=warengonzaga/thirdweb-support-discord-bot)](https://github.com/warengonzaga/thirdweb-support-discord-bot/graphs/contributors)

---

💻💖☕ by [Waren Gonzaga](https://warengonzaga.com) | [He is Awesome](https://www.youtube.com/watch?v=HHrxS4diLew&t=44s) 🙏
> **Note**: If you want to use this bot on your community I would recommend to use the [public version](https://github.com/warengonzaga/forum-based-support-discord-bot) of it. Thank you!
4 changes: 4 additions & 0 deletions src/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ client.on('threadCreate', async post => {
const resolutionTime = `=IFERROR(VLOOKUP(A2:A,${config.datasheet_resolve}!A2:B,2,0))`;
const closeTime = `=IFERROR(VLOOKUP(A2:A,${config.datasheet_close}!A2:B,2,0))`;
const escalationTime = `=IFERROR(VLOOKUP(A2:A,${config.datasheet_escalate}!A2:B,2,0))`;
const bugTime = `=IFERROR(VLOOKUP(A2:A,${config.datasheet_bug}!A2:B,2,0))`;
const responder = `=IFERROR(VLOOKUP(A2:A,{${config.datasheet_response}!A2:A,${config.datasheet_response}!C2:C},2,0))`;
const resolvedBy = `=IFERROR(VLOOKUP(A2:A,{${config.datasheet_resolve}!A2:A,${config.datasheet_resolve}!C2:C},2,0))`;
const closedBy = `=IFERROR(VLOOKUP(A2:A,{${config.datasheet_close}!A2:A,${config.datasheet_close}!C2:C},2,0))`;
const escalatedBy = `=IFERROR(VLOOKUP(A2:A,{${config.datasheet_escalate}!A2:A,${config.datasheet_escalate}!C2:C},2,0))`;
const escalationLink = `=IFERROR(VLOOKUP(A2:A,{${config.datasheet_escalate}!A2:A,${config.datasheet_escalate}!D2:D},2,0))`;
const bugBy = `=IFERROR(VLOOKUP(A2:A,{${config.datasheet_bug}!A2:A,${config.datasheet_bug}!C2:C},2,0))`;

// send the data
sendData({
Expand All @@ -345,6 +347,8 @@ client.on('threadCreate', async post => {
escalation_time: escalationTime,
escalated_by: escalatedBy,
escalation_link: escalationLink,
bug_time: bugTime,
bug_by: bugBy
}, config.datasheet_init);
});

Expand Down

0 comments on commit 1d03015

Please sign in to comment.