Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct { ConsumerKey string ConsumerSecret string AccessToken string AccessTokenSecret string }
Credentials contains the authentication credentials needed for twitter api access
ConsumerKey and ConsumerSecret can be thought of as the user name and password that represents your Twitter developer app when making API requests.
An access token and access token secret are user-specific credentials used to authenticate OAuth 1.0a API requests. They specify the Twitter account the request is made on behalf of.
See https://developer.twitter.com/en/docs/authentication/oauth-1-0a for more details.
type Twitter ¶
type Twitter struct {
// contains filtered or unexported fields
}
Twitter struct holds necessary data to communicate with the Twitter API.
func New ¶
func New(credentials Credentials) (*Twitter, error)
New returns a new instance of a Twitter service. For more information about Twitter access token:
-> https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens
func (*Twitter) AddReceivers ¶
AddReceivers takes TwitterIds and adds them to the internal twitterIDs list.
func (Twitter) Send ¶
Send takes a message subject and a message body and sends them to all previously set twitterIDs as a DM. See https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event