Discord chat bot to announce projects #590

Merged
h3n3 merged 3 commits from refs/pull/590/head into main 2022-01-13 21:11:30 +01:00
h3n3 commented 2022-01-09 22:11:47 +01:00 (Migrated from gitea.opdethuisserver.nl)

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)
h3n3 commented 2022-01-10 20:56:35 +01:00 (Migrated from gitea.opdethuisserver.nl)

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

This looks really promising 🚀 , I'll respond to you properly after work.
h3n3 commented 2022-01-11 08:50:26 +01:00 (Migrated from gitea.opdethuisserver.nl)

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)
h3n3 commented 2022-01-11 16:59:12 +01:00 (Migrated from gitea.opdethuisserver.nl)

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

Yeah, this looks great! Ready to merge when you are.
h3n3 (Migrated from gitea.opdethuisserver.nl) approved these changes 2022-01-13 21:11:20 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h3n3/cadhub!590
No description provided.