Skip to content
/ bots Public

Bots providing gas prices from several chains to users.

License

Notifications You must be signed in to change notification settings

owlracle/bots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Owlracle Bots

This is Owlracle's repo for his bots. All the bots serve a key function in the Owlracle ecossystem, delivering gas prices to different platforms using Owlracle's API.

Table of Contents

  1. Install
  2. Telegram Bot
  3. Discord Bot
  4. Twitter Bot
  5. Contact and Support

Install the bots

All bots come with the same repo. Before getting any of them to work, you must first clone the repo

git clone https://github.com/owlracle/telegram_bot.git

Then go to the dir, then install dependencies

npm init

All of Owlracle's bots in this repo share the same config.json file. You must create this file on repo root with the following format:

{
    "telegram": {
        "token": "TELEGRAM_BOT_TOKEN",
        "groups": {}
    },
    "discord": {
        "token": "DISCORD_BOT_TOKEN",
        "groups": {}
    },
    "twitter": {
        "apiKey": "TWITTER_CONSUMER_API_KEY",
        "secret": "TWITTER_CONSUMER_API_SECRET",
        "bearer": "TWITTER_AUTHENTICATION_BEARER_TOKEN",
        "access": "TWITTER_AUTHENTICATION_ACCESS_TOKEN",
        "accessSecret": "TWITTER_AUTHENTICATION_ACCESS_SECRET",
        "owlracleKey": "OWLRACLE_API_KEY",
	"blacklist": []
    },
    "alert": {
        "enabled": false,
        "token": "TELEGRAM_ALERT_BOT_TOKEN",
        "chatId": "TELEGRAM_USER_CHATID"
    }
}
  • telegram: Information about your Telegram bot setup.
    • token: The TELEGRAM_BOT_TOKEN is taken from Telegram service when you create your bot. For instructions about how to set a new bot, refer to the Telegram docs.
    • groups: Object that will be filled when Telegram groups add your bot.
  • discord: Information about your Discord bot setup.
    • token: The DISCORD_BOT_TOKEN is taken from Discord service when you create your bot. For instructions about how to set a new bot, refer to the discord.js docs.
    • groups: Object that will be filled when Discord servers add your bot.
  • twitter: Information about your Twitter bot setup.
    • apiKey: The TWITTER_CONSUMER_API_KEY and all other tokens can be generated on Tweeter Developer Portal. Know more about it at Twitter API docs.
    • secret: The TWITTER_CONSUMER_API_SECRET is generated at the same time as TWITTER_CONSUMER_API_KEY.
    • bearer: The TWITTER_AUTHENTICATION_BEARER_TOKEN Is used to identify your application. See apiKey above.
    • access: The TWITTER_AUTHENTICATION_ACCESS_TOKEN is used to get authorization to post a tweet. See apiKey above.
    • accessSecret: The TWITTER_AUTHENTICATION_ACCESS_SECRET is generated together with TWITTER_AUTHENTICATION_ACCESS_TOKEN. See apiKey above.
    • owlracleKey: Whoever running this bot must provide an Owlracle API key. You can generate one here.
    • blacklist: List of tweeter users that will not get a reply from Owlracle bot. This list is useful to prevent replying to other bots.
  • alert: This is used to receive alerts from your bot on your personal Telegram.
    • enabled: If set to true, you will receive telegram alerts.
    • token: The token for the Telegram bot that will send you the alerts. This is not the same Owlralce Telegram bot we will use for gas prices.
    • chatId: This is your personal account chat id (google about it).

After that you are ready to start the bots.

Owlracle's Telegram Bot

This repo is about Owlracle Telegram Bot's webhook. Before you must have created a Telegram bot. For more information about this, check Telegram docs.

Usage

Run the bot:

node telegram.js

Now you can interact with your bot. Invite him to one of your groups and start interacting with him:

\start

That is it! Enjoy.

Owlracle's Discord Bot

This repo deals with the Owlracle Discord Bot webhook. Before running your bot you must have create it. Go to Discord's dev portal and create your bot. Look at some resources like this as to how to do it properly.

Usage

Run the bot:

node discord.js

Now your bot must be added to the desired server. If you followed a tutorial on how to make a discord bot, you know what this is about. After your bot is running, you can start talking to him with !start or /start.

You can test it on Owlracle's Telegram group.

That is it! Enjoy.

Owlracle's Twitter Bot

This repo deals with the Owlracle Twitter Bot webhook. You will tie your bot's logic with an existing Twitter account. Check their docs to know more about their API. The tokens provided in config.json will bound the bot with the account.

Usage

Run the bot:

node twitter.js

You could also use any of the optional arguments:

  • -a: Aggressive mode. This mode will not require the bot to be mentioned, or the hashtag #gas be present in the tweet. Instead, any tweet with the words gas prices or hashtags #gas or #gasprice that contain a network reference will trigger the bot reply.
  • -r "RULES": Custom rules. The bot will run with the rules of your choosing. Refer to the twitter docs to learn about rules formatting.

Now the bot will fetch gas prices using Owlracle API and tweet a reply to whoever make a tweet containing the following:

  • A mention to the bot's bound profile. Not needed when on aggressive mode.
  • The hashtag #gas. When on aggressive mode, other keywords can be used instead.
  • A reference to any supported network. Any of the following will work:
    • BSC: bsc, bnb, binance.
    • Polygon: poly, matic, polygon.
    • Fantom: ftm, fantom.
    • Avalanche: avax, avalanche.
    • Ethereum: eth, ethereum.
    • Moonriver: movr, moonriver.
    • Cronos: cro, moonriver.

Check a sample tweet in the image above.

You can also test it sending a tweet to @owlracleapi.

That is it! Enjoy.


Contact us:

Like what we are doing?

Then support our project! We accept any token donation on BSC, Polygon, Fantom, Ethereum, and Avalanche networks.

About

Bots providing gas prices from several chains to users.

Resources

License

Stars

Watchers

Forks