Skip to content

peakshift/telegram-dogecoin

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

52 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Prerequisites

Setup Block.io Account

block.io will be used by the bot so it can create and label wallets for users who type /register.

  1. Go to block.io and create an account (free)
  2. Set a pin, and save your mnemonic phrase offline. This will be used to generate your wallet again in the event you lose access to your account so always have the habit of keeping this safe.
  3. Click on "Show API Key" then copy the key for "Dogecoin (testnet)"

Create a Telegram Bot @BotFather

Further bot documentation link

  1. Start a chat with @botfather
  2. Type /newbot then follow the instructions
  3. @botfather will send you your bot's authentication token

Create a Github Access Token

  1. Goto your github account settings
  2. Click on Developer Settings
  3. Click on Personal Access Tokens
  4. Here Generate a New Token.
  5. Give it a Name and give it Permissions of repo and click on Generate Token.
  6. Your token will look like : g96641055hua1d959e2112232225f77c89182a794a

Getting Started

Once you have a Block.io Account setup, and created your own Telegram Bot it's time to clone the project and get it setup.

  1. git clone [email protected]:peakshift/telegram-dogecoin.git
  2. cd telegram-dogecoin
  3. pip install block-io
  4. pip install requests
  5. pip install behave
  6. TELEGRAM_BOT_TOKEN=<your token> BLOCKIO_API_KEY=<your key> BLOCKIO_PIN=<your pin> GITHUB_ACCESS_TOKEN=<github access token> python3 run.py

In step 5, replace the entire of <your token>, <your token>, <your token>,<github access token>.

Contributing

Branches

  • A branch name should begin with the issue number, and have short name (2-4 words). New features or fixes should be based off of the master branch.
    • git checkout -b 123-short-name master

Testing

When making changes or adding a new feature, to ensure the feature works correctly or the changes made have not broken the code then you can do unit testing using the behave framework and gherkin scenarios. *Behave Framework Docs

To begin testing your scenarios

  • do pipenv install
  • run pipenv run behave
  • if it passes
    • commit and push your branch
    • checkout develop and merge your branch
    • push the develop branch
    • open a pull request for your branch in master
  • if it fails
    • fix the problem so all tests pass

Pushing Changes

  1. Open Terminal.
  2. git pull
  3. git add file_name.py
  4. git commit -m "type(component): subject line"
  5. git push origin 123-short-name

Commit Messages

We follow the Angular commit guidelines so that we can generate changelogs and have a clean commit history โ€” see Pushing Changes #3 for an example commit.

  • Type, for your commit message commiting you should select a type from this list below:
    • feat: a new features
    • fix: a bug fix
    • docs: documentation only changes
    • style: changes that do not affect the menaing of the code (white-space, formatting, missing semi-colons, etc)
    • refactor: a code change that neither fixes a bug or adds a feature
    • pref: a code change that improves performance
    • test: adding missing tests
    • chore: changes to the build process or auxiliary tools and libraries such as documentation generation
  • Components, represent the larger feature / scope of the change
  • Subject line, use the imperative form of a verb
    • GOOD "add contributing guidelines"
    • BAD "adding contribuing guidelines"

Packages

No packages published

Languages

  • Python 100.0%