My Command :
In chat :
/scoreboard objectives add firstJoin dummy
Command Block :
(Repeating, Always Active)
execute as @a[scores={firstJoin=0..0}] ~ ~ ~ dialogue open @p popup (my npc name)
(Chain, Conditional, Always Active)
scoreboard players set @a[scores={firstJoin=0..0}] firstJoin 1
(Chain, Conditional, Always Active)```
I haven't tested it yet..