Discord Integration for notifications - flow, webhooks, activity

Hi not sure where to put this:
I want to be able to send notifications to my Discord Channel when someone Downloads a file or files. I cant find anything to do this. Please help this would be greatly helpful and appreciated

Could be done with an rss bot and the activity app.
Or, could be possible with the webhooks app.

You’d have to figure out how to filter the results from the activity feed to only show what you want.

Since i have no experience in writing code or values …as i think the webhook app would work… ive tried what i know and even did flows. nothing lol you would think nextcloud would have this integration app but maybe imi wrong

Webhooks apps has been developed by a 3rd party.
It integrates into Flow as you know, but that needs an additional app

You can use this to write custom scripts to respond to the sorts of events you have described. Not sure how to write such a script, but this is where you would figure that out.

I looked into this general topic more and have more info. Bear with me:

Available Webhook events - copypasta of types supported when you click me

Available events

Calendar Object Created

Fires whenever a calendar event is created.
Config name: webhooks_calendar_object_created_url

Calendar Object Updated

Fires whenever a calendar event is edited (including meeting participant accepting/declining invitations).
Config name: webhooks_calendar_object_updated_url

Calendar Object Moved to Trash

Fires whenever a calendar event is soft-deleted (moved to trash).
Config name: webhooks_calendar_object_moved_to_trash_url

Calendar Object Deleted

Fires whenever a calendar event is permanently deleted (i.e. deleted from the trashbin).
Config name: webhooks_calendar_object_deleted

Login Failed

Fires whenever a login attempt with an existing username fails.
Config name: webhooks_login_failed_url

Password Updated

Fires whenever user’s password is changed.
Config name: webhooks_password_updated_url

Share Created

Fires whenever a new share is created.
Config name: webhooks_share_created_url

User Changed

Fires whenever a user account is edited. Includes values before and after edit.
Config name: webhooks_user_changed_url

User Created

Fires whenever a new user is created.
Config name: webhooks_user_created_url

User Deleted

Fires whenever a user account is deleted.
Config name: webhooks_user_deleted_url

User Live Status Updated

Fires whenever user’s live status is updated to online (happens when user navigates between apps and doesn’t necessarily indicate that the status changed).
Config name: webhooks_user_status_url

User Logged In

Fires whenever a user logs in successfully.
Config name: webhooks_user_logged_in_url

User Logged Out

Fires whenever a user logs out successfully.
Config name: webhooks_user_logged_out_url

Flow events

  • File created
  • File updated
  • File renamed
  • File copied
  • File deleted
  • Tag assigned

As far as sending the notification on a file upload or change, seems that is being done with external script support in flow…

curl -d @%f http://your.awesome.api/uploadfile
Or something like this.

Unfortunately required in this case. Here is a request on improving Webhooks configuration from the webui.

If you want to try this method you’ll need to install the download shared activity app and then apply your own filtering to the rss feed from activity.
See Activity tab in sidebar doesn’t show activity inside folder · Issue #45 · nextcloud/activity · GitHub
and https://github.com/nextcloud/activity/issues/464

Thank you for replying ! i will check into all this. The RSS feed would have worked if the Activity settings button worked. jsut click and nothing. cant enable RSS. but i will definitely look at all of this :slight_smile:

I thought of a way you could do this…

  • Create a fake user with a name like “DIspatch”
  • Confirm “Dispatch” will automatically accept whatever group or others shares you send to it without needing any additional confirmation, so you won’t need to login.
  • Installed shared download activities app
  • Enable RSS in activity app for “Dispatch”
  • Configure activity app in user settings to only relay shared download activities
  • Share RSS feed to your Discord using whatever RSS bot on that end.

Profit. Dispatch’s activity rss will now be relayed to your Discord room.
Main issue with this approach is it is not really scabable beyond one room per user created. :slight_smile:

If you want to scale the activities of one user across multiple rooms you can use FreshRSS or a similar 3rd party service to filter and re-share that RSS feed… but, that obviously requires more tooling.

2 Likes