© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago
Mr Void

On insert -> send http request to discord webhook

I created a function
send_feedback_to_discord
send_feedback_to_discord
:
declare
  username text;
begin
  SELECT public.users.username INTO username FROM public.users WHERE id = user_uuid;
  perform net.http_post(
        url:='https://discord.com/api/webhooks/.../...',
        headers:='{"Content-Type": "application/json"}'::jsonb,
        body:=json_build_object('content', '**' || username || '**: ' || feedback)::jsonb
    );
  return;
end;
declare
  username text;
begin
  SELECT public.users.username INTO username FROM public.users WHERE id = user_uuid;
  perform net.http_post(
        url:='https://discord.com/api/webhooks/.../...',
        headers:='{"Content-Type": "application/json"}'::jsonb,
        body:=json_build_object('content', '**' || username || '**: ' || feedback)::jsonb
    );
  return;
end;


and a trigger that listens to INSERT events on
feedback
feedback
table.
My problem is that I am unable to choose
send_feedback_to_discord
send_feedback_to_discord
as a function to call in the trigger. "Only functions that return a trigger will be displayed below".

How to proceed?

I wish to call
send_feedback_to_discord
send_feedback_to_discord
function with
user_id
user_id
value from the new row as a parameter, when the row is inserted.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to send database webhook to discord with supabase
SupabaseSSupabase / help-and-questions
3y ago
Can I call edge with a HTTP Request webhook?
SupabaseSSupabase / help-and-questions
4y ago
Failed to create webhook supabase_functions.http_request() does not exist
SupabaseSSupabase / help-and-questions
3y ago
How to do HTTP Request on the mart scheme?
SupabaseSSupabase / help-and-questions
3mo ago