Is there a way to invoke deluge function from within a widget?

Is there a way to invoke deluge function from within a widget?

Hi! I have custom functions in deluge and I was wondering whether there is any way to call this function through a widget?

Something like on click of a button inside a widget, run the deluge custom function.

Would this be possible?