Discord chat bot to announce projects #590

Merged
smartin015 merged 3 commits from discord_bot into main 2022-01-13 21:11:30 +01:00
smartin015 commented 2022-01-09 22:11:47 +01:00 (Migrated from github.com)

Closes #589

This adds support for a Discord bot that announces when interesting things happen on the backend. It's currently set up to notify when someone saves a new project image, as a proxy for "done-ness" to the point where folks might want to take a look and comment on the project. It has some limitations to keep the usage simple - it only sends text, and only to a single channel configured on startup (see .env.defaults). However, the bot (and lib) could very easily be modified to do more advanced stuff, e.g. responding to user chats from Discord.

While I was able to successfully set up a bot and have it talk on a channel, this PR isn't quite complete:

  • I wasn't able to fully test the actual notifications as I'm missing CLOUDINARY_API_SECRET in my env - it prevents me from setting a project image and thus firing the bot message when the project is updated.
  • IMO the chat message should be a URL to the updated project (easy to click and follow) but I'm not quite sure how to generate a link to the project from the backend. Any thoughts on how to do this in a nice way?

Screenshot from 2022-01-09 16-10-11

Closes #589 This adds support for a Discord bot that announces when interesting things happen on the backend. It's currently set up to notify when someone saves a new project image, as a proxy for "done-ness" to the point where folks might want to take a look and comment on the project. It has some limitations to keep the usage simple - it only sends text, and only to a single channel configured on startup (see `.env.defaults`). However, the bot (and lib) could very easily be modified to do more advanced stuff, e.g. responding to user chats from Discord. While I was able to successfully set up a bot and have it talk on a channel, this PR isn't quite complete: * I wasn't able to fully test the actual notifications as I'm missing `CLOUDINARY_API_SECRET` in my env - it prevents me from setting a project image and thus firing the bot message when the project is updated. * IMO the chat message should be a URL to the updated project (easy to click and follow) but I'm not quite sure how to generate a link to the project from the backend. Any thoughts on how to do this in a nice way? ![Screenshot from 2022-01-09 16-10-11](https://user-images.githubusercontent.com/607666/148701109-7e46e9db-e8fb-4900-bc4f-15a0877de9f8.png)
Irev-Dev commented 2022-01-10 20:56:35 +01:00 (Migrated from github.com)

This looks really promising 🚀 , I'll respond to you properly after work.

This looks really promising 🚀 , I'll respond to you properly after work.
Irev-Dev commented 2022-01-11 08:50:26 +01:00 (Migrated from github.com)

I made a PR to this PR haha, https://github.com/smartin015/cadhub/pull/1 (I don't like stomping on other people's branches with my commits)

I think this is ready if you are happy with the changes I made, here's what the messages look like with the image.

image

I made a PR to this PR haha, https://github.com/smartin015/cadhub/pull/1 (I don't like stomping on other people's branches with my commits) I think this is ready if you are happy with the changes I made, here's what the messages look like with the image. ![image](https://user-images.githubusercontent.com/29681384/148902046-955b0fa6-5064-443b-b02d-08f9b6f53b80.png)
smartin015 commented 2022-01-11 16:59:12 +01:00 (Migrated from github.com)

Yeah, this looks great! Ready to merge when you are.

Yeah, this looks great! Ready to merge when you are.
Irev-Dev (Migrated from github.com) approved these changes 2022-01-13 21:11:20 +01:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#590