A cash advance is not bad for your credit if you repay it as agreed. However, credit card cash advances won't be listed as a separate item on your credit report. So it can indirectly affect your credit score if your credit utilization ratio goes over 30% because of it.
Payday cash advances from direct lenders won't affect your credit either if you repay them on time. That's why if you need a cash loan, it's best to get it from a private lender instead of your card issuer.