def METHOD_NAME(token, userid, message):
    async def send_to_discord_async(token, userid, message):
        intents = DiscordIntents.default()
        intents.members = True
        client = DiscordClient(intents=intents)
        @client.event
        async def on_ready(userid=userid, message=message):
            user_found = False
            for user in client.get_all_members():
                if not user.bot and (
                    (user.discriminator == "0" and user.name == userid)
                    or (f"{user.name}#{user.discriminator}" == userid)
                ):
                    embed = DiscordEmbed()
                    embed.description = message
                    await user.send(embed=embed)
                    user_found = True
                    break
            if not user_found:
                logger.info("User %s not found by Discord bot" % userid)
            await client.close()
        await client.start(token)
    if token:
        if userid:
            try:
                asyncio.set_event_loop(asyncio.new_event_loop())
                loop = asyncio.get_event_loop()
                loop.run_until_complete(
                    send_to_discord_async(token, userid, message)
                )
            except Exception:
                logger.info("Exception when sending a Discord notification:")
                logger.info(traceback.format_exc())
            finally:
                if loop:
                    loop.close()
        else:
            logger.info("The userid of Discord user is not defined.")
    else:
        logger.info(
            "The token of the Discord bot for sending notifications is not defined."
        )