Pukima
03/09/2022, 12:19 PMgaryaustin
03/09/2022, 4:11 PMPukima
03/09/2022, 6:03 PMPukima
03/09/2022, 6:07 PMgaryaustin
03/09/2022, 7:22 PMlet memberArray = []
if (data.length) memberArray = data[0].member_join
if (!memberArray.includes(roleId)) memberArray.push(roleId)
If I got that correct it should insert a new role if there was no guild_id match (new record), the array is empty or the role does not exist in the array. You could probably also optimize to not do the upsert if your rollId already exists if appropriate.Pukima
03/10/2022, 5:51 AMPukima
03/10/2022, 5:52 AMPukima
03/10/2022, 5:52 AM