Twitter is a bit more complicated. It's most likely that the bad guys got a hold of your password. There have been several big leaks of passwords or password hashes for Twitter. Some of them are collected via malware and others are collected not from the users but through other means including hacking Twitter.
You don't have to worry about malware "in your twitter account" or anything like that. You can log in and change your password.
Also, be sure you change that password in any other accounts you happen to use it.
But, Twitter is complicated. They have an API with access tokens. It's possible a token was stolen and not your password. See:https://support.twitter.com/articles/76 ... plications
You should revoke all API access to any other site or application. After you've changed your password head to:https://twitter.com/settings/applications