From visiting your site, I think your WordPress site is functioning as the DiscourseConnect authentication provider for your Discourse site. If that is correct, you can use the add_user_to_discourse_group
helper function to add WordPress users to Discourse groups: wp-discourse/lib/utilities.php at main · discourse/wp-discourse · GitHub. Details about using the function are here:
Note the use
statement at the top of the code example:
use WPDiscourse\Utilities\Utilities as DiscourseUtilities;
And how that is then used to call the (static) function:
$result = DiscourseUtilities::add_user_to_discourse_group( $user_id, $group_name );