OleJul wrote:
I have not used the pencil for a long time and it is completely discharged
... and I'm afraid that is the issue. Lithium batteries (not just in the Apple Pencils) if left uncharged for long periods of time, lose their ability to be recharged. This is most likely the case here. Unfortunately, Apple does not repair them. If you want to continue using these pencils with your iPad, you will need to get a replacement.
After you do, be sure, if you are going to leave it unused for an extended period of time (think months), be sure to leave it charged. In addition, at least once a month, use/charge it to maintain the battery's condition.