Ok, before explaining anything, this triggers on a public message (chan msg not private). You wanted it to check the first 10 letters if they contain the word !donate; this is what this code does, so make sure "!donate" is in the first 10 letters.
But its not possible to set it with a certain name?
And that the bot considers the first 10 letters is unimportant now. But can the bot considers only the first word?
Don't you learn anything from what you're given here? What you've got in this thread is more than enough to teach you how to do it yourself. To check if $nick equals a certain nick use: