Skip to content

delta-rs/x-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Delta 𝕏 Bot

The official 𝕏 bot for Delta.

What the X Bot Does

The X bot posts updates to @deltaml_org with information from the GitHub API.

The bot uses the GitHub API to:

  • Detect when a new contributor makes their first commit to the master branch of the delta repository.
  • Detect when a new release of the delta repository is published.

The bot uses the X API to:

  • Post a message to @deltaml_org whenever a new contributor makes their first commit to the master branch of the delta repository.
  • Post a message to @deltaml_org whenever a new release of the delta repository is published.

Setup

  1. Clone the repository
  2. Set up environment variables:
    • GITHUB_TOKEN: GitHub API token
    • X_API_KEY: X (Twitter) API key
    • X_API_SECRET: X (Twitter) API secret
    • X_ACCESS_TOKEN: X (Twitter) access token
    • X_ACCESS_SECRET: X (Twitter) access token secret
    • REPO_OWNER: The owner of the GitHub repository
    • REPO_NAME: The name of the GitHub repository

Github Token Setup

  1. Go to your GitHub account settings
  2. Navigate to Developer settings > Personal access tokens
  3. Generate a new token (classic) with the repo and admin:repo_hook scopes

Github Repo Webhook Setup

  1. Go to your GitHub repository settings
  2. Navigate to Webhooks > Add webhook
  3. Enter the webhook URL from the environment variable WEBHOOK_PATH
  4. Select the events, "Push" and "Releases" you want to trigger the webhook

Webhooks

  • Definition : Webhooks are HTTP callbacks that allow one application to send real-time data to another whenever a specific event occurs.
  • Communication : They use a request-response model. When an event occurs, the source application makes an HTTP POST request to a predefined URL (the webhook endpoint) on the target application, sending data about the event.
  • Use Case : Commonly used for event-driven architectures where you want to notify another service about events, such as GitHub sending a notification about a new commit or release.
  • Example : When a new issue is created in a GitHub repository, GitHub can send a webhook notification to your application to inform it of the new issue.

X api Setup

Get these from the X Developer Portal (https://developer.twitter.com/en/portal/dashboard)

  1. Go to your X (Twitter) dashboard
  2. Navigate to your API keys
  3. Create a new API key

If anything is unclear, reach out in the Github Discussions here on GitHub.

Contributors

The following contributors have either helped to start this project, have contributed code, are actively maintaining it (including documentation), or in other ways being awesome contributors to this project. We'd like to take a moment to recognize them.

mjovanc dmbtechdev

License

The MIT License.

Releases

No releases published

Packages

No packages published