Heyy *offers hugs*
You're not weak at all. I'm really sorry you slipped up, I do know how frustrating that can be. But I also think it's amazing that you managed to go for so long without it, and that shows that you're not weak in the slightest. You've done really well, and you can keep going with this.
Slipping up is just a part of recovery, and we've all been there. It feels horrible, but you don't have to let it discourage you, you do have a choice about how you respond. You don't have to beat yourself up about it; that'll only make you feel worse and make you want to hurt yourself more. And you don't have to see it as a reason to keep self harming. I do that too, when I slip - I feel bad about it but at the same time I'm like 'oh, okay, I'll just keep doing it'. But really, you can also choose to continue with recovery, to see this for what it is, just one slip up. And to use it to learn from and see what you can do instead next time.
I honestly don't think it was a 'bad' reason to give in or anything. You might have had worse days but when you're tired and you want to sleep and you're just lying there without anything really to distract you, it's often really hard to resist. What do you usually do when you want to self harm, what kind of things help you? Just remind yourself of all the things that usually help, and try to keep on using them. I'm sure you've learned a lot in the past few months. If I feel bad and I can't sleep, sometimes I find it helps to get up for a while, maybe make some hot chocolate or something and read or watch part of a film. Then go try again when you're feeling calmer. Maybe you could try something like that if it happens again?
It's good that you know what triggered you. Do you want to talk about the thoughts that were keeping you awake? We're all here if you do want to talk about anything. How are things in general? You say that you have these thoughts every night, and that must be pretty hard to deal with. Sometimes we can focus so much on trying to stop self harm, but it's also important to try to sort out the stuff that's behind it. Is that something you're trying to do? Do you have any kind of support - like seeing a counsellor, or even just being able to talk to friends or family or something? If not, it might be something to think about. Everyone needs some help sometimes.
Make sure you take care of your cuts, and try to be gentle with yourself. You can get through this without slipping back to where you were. You haven't failed or anything. If you need to talk or anything, I'm here, just PM me anytime. Take care of yourself xo