create account

statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes by superoo7

View this thread on: hive.blogpeakd.comecency.com
· @superoo7 · (edited)
$206.40
statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes
statBot is a utility discord bot being used in #teammalaysia, AUS/NZ and Steemph.cebu. This bot has features like cryptocurrency price check, cryptocurrency conversion rate (between crypto to crypto and crypto to fiat)

![favicon.png](https://cdn.utopian.io/posts/127cfc98dde95eba023bdbc2c8a587ff899efavicon.png)

# Commit history

![Screen Shot 2018-04-25 at 2.14.37 PM.png](https://cdn.utopian.io/posts/b6e122f699417225ed913af9750558c067e1Screen_Shot_2018-04-25_at_2.14.37_PM.png)


### New Features
- What feature(s) did you add?
  
  * All source code rewritten into TypeScript. (Old codes is at `old_src`)
  * Added Discord Embedded Message to increase readability

![Screen Shot 2018-04-25 at 2.43.22 PM.png](https://cdn.utopian.io/posts/e6521d076ecdfd552673ef0686e6e41df85eScreen_Shot_2018-04-25_at_2.43.22_PM.png)  
![Screen Shot 2018-04-25 at 2.43.42 PM.png](https://cdn.utopian.io/posts/c39e1275ca0ad93ad6c4ec2eae2c2327505cScreen_Shot_2018-04-25_at_2.43.42_PM.png)

* Added new search for a certain tag performance. (Search of a tag from 01/01/2017 until today)

![Screen Shot 2018-04-25 at 2.43.30 PM.png](https://cdn.utopian.io/posts/51bbc9417da85358d7268a2b03926dab053dScreen_Shot_2018-04-25_at_2.43.30_PM.png)
  * Check price of a crypto directly with `%price btc` or `$btc`
![Screen Shot 2018-04-25 at 2.59.44 PM.png](https://cdn.utopian.io/posts/89c208fa917f4f39b6d2a91a307d74a92a1aScreen_Shot_2018-04-25_at_2.59.44_PM.png)


- How did you implement it/them?

  * Typescript is used, so that the code are easier to be mantained. Testing will be added in the next contribution.
  * Embedded message is done instead of sending strings like 'Hello World', send in with embed object.

```
{
    embed: {
      color: color.green,
      description: 'Created by @superoo7',
      fields: [
        {
          name: 'License',
          value: 'on 2017-2018 (MIT LICENSE)'
        },
        {
          name: 'GitHub Repository',
          value: 'https://github.com/superoo7/steem-discord'
        }
    ],
    timestamp: new Date(),
    footer: {
      icon_url: client.user.avatarURL,
      text: '© superoo7'
    }
  }
}
```

  * Search is done with SteemSQL. The SQL queries are here:

```
select
 SUM(net_votes) as Votes,
 SUM(pending_payout_value) as PendingPayouts,
 SUM(children) as Comments,
 COUNT(*) as Posts
from
 Comments
where
 depth = 0 AND
 created >= '2017/01/01' AND
 CONTAINS(json_metadata, 'utopian-io')
order by
 Votes desc
```

### About this Projects
- What is the project about?

  This is a discord bot that are able to consume Steem API, check crypto price, convert crypto and fiat price, use of SteemSQL to carry out Query about Steem Blockchain.

- Technology Stack

TypeScript,  MSSQL(SteemSQL)

- Roadmap
  * Check delegators and delegatee
  * Coversion of fiat to fiat
  * Added Testing (Jest)
  * Detail documentation on all the available commands

- How to contribute?

To contribute, first you need to have SteemSQL subscription.

Edit the `.env` file, and paste ur SteemSQL subscription details into it
    
Pull Request and Issue filling are welcomed on [GitHub](https://github.com/superoo7/steem-discord)

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@superoo7/statbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 281 others
properties (23)
authorsuperoo7
permlinkstatbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":115837175,"name":"steem-discord","full_name":"superoo7/steem-discord","html_url":"https://github.com/superoo7/steem-discord","fork":false,"owner":{"login":"superoo7"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","teammalaysia","discord","javascript","cn-programming"],"users":["superoo7"],"links":["https://cdn.utopian.io/posts/127cfc98dde95eba023bdbc2c8a587ff899efavicon.png","https://cdn.utopian.io/posts/b6e122f699417225ed913af9750558c067e1Screen_Shot_2018-04-25_at_2.14.37_PM.png","https://cdn.utopian.io/posts/e6521d076ecdfd552673ef0686e6e41df85eScreen_Shot_2018-04-25_at_2.43.22_PM.png","https://cdn.utopian.io/posts/c39e1275ca0ad93ad6c4ec2eae2c2327505cScreen_Shot_2018-04-25_at_2.43.42_PM.png","https://cdn.utopian.io/posts/51bbc9417da85358d7268a2b03926dab053dScreen_Shot_2018-04-25_at_2.43.30_PM.png","https://cdn.utopian.io/posts/89c208fa917f4f39b6d2a91a307d74a92a1aScreen_Shot_2018-04-25_at_2.59.44_PM.png","https://github.com/superoo7/steem-discord"],"image":["https://cdn.utopian.io/posts/127cfc98dde95eba023bdbc2c8a587ff899efavicon.png","https://cdn.utopian.io/posts/b6e122f699417225ed913af9750558c067e1Screen_Shot_2018-04-25_at_2.14.37_PM.png","https://cdn.utopian.io/posts/e6521d076ecdfd552673ef0686e6e41df85eScreen_Shot_2018-04-25_at_2.43.22_PM.png","https://cdn.utopian.io/posts/c39e1275ca0ad93ad6c4ec2eae2c2327505cScreen_Shot_2018-04-25_at_2.43.42_PM.png","https://cdn.utopian.io/posts/51bbc9417da85358d7268a2b03926dab053dScreen_Shot_2018-04-25_at_2.43.30_PM.png","https://cdn.utopian.io/posts/89c208fa917f4f39b6d2a91a307d74a92a1aScreen_Shot_2018-04-25_at_2.59.44_PM.png"],"moderator":{"account":"justyy","time":"2018-04-25T14:47:26.359Z","pending":false,"reviewed":true,"flagged":false},"questions":{"voters":["cha0s0000","justyy"],"answers":[{"question_id":"dev-1","answer_id":"dev-1-a-1","user":"cha0s0000","influence":60},{"question_id":"dev-2","answer_id":"dev-2-a-2","user":"cha0s0000","influence":60},{"question_id":"dev-3","answer_id":"dev-3-a-2","user":"cha0s0000","influence":60},{"question_id":"dev-4","answer_id":"dev-4-a-2","user":"cha0s0000","influence":60},{"question_id":"dev-5","answer_id":"dev-5-a-2","user":"cha0s0000","influence":60},{"question_id":"dev-6","answer_id":"dev-6-a-1","user":"cha0s0000","influence":60},{"question_id":"dev-7","answer_id":"dev-7-a-2","user":"cha0s0000","influence":60},{"question_id":"dev-1","answer_id":"dev-1-a-2","user":"justyy","influence":75},{"question_id":"dev-2","answer_id":"dev-2-a-2","user":"justyy","influence":75},{"question_id":"dev-3","answer_id":"dev-3-a-2","user":"justyy","influence":75},{"question_id":"dev-4","answer_id":"dev-4-a-2","user":"justyy","influence":75},{"question_id":"dev-5","answer_id":"dev-5-a-2","user":"justyy","influence":75},{"question_id":"dev-6","answer_id":"dev-6-a-2","user":"justyy","influence":75},{"question_id":"dev-7","answer_id":"dev-7-a-2","user":"justyy","influence":75}],"total_influence":0,"most_rated":[{"question_id":"dev-1","answer_id":"dev-1-a-2","influence":75,"voters":["justyy"]},{"question_id":"dev-2","answer_id":"dev-2-a-2","influence":135,"voters":["cha0s0000","justyy"]},{"question_id":"dev-3","answer_id":"dev-3-a-2","influence":135,"voters":["cha0s0000","justyy"]},{"question_id":"dev-4","answer_id":"dev-4-a-2","influence":135,"voters":["cha0s0000","justyy"]},{"question_id":"dev-5","answer_id":"dev-5-a-2","influence":135,"voters":["cha0s0000","justyy"]},{"question_id":"dev-6","answer_id":"dev-6-a-2","influence":75,"voters":["justyy"]},{"question_id":"dev-7","answer_id":"dev-7-a-2","influence":135,"voters":["cha0s0000","justyy"]}]},"score":74.25,"total_influence":135,"staff_pick":null,"config":{"questions":[{"question":"How would you describe the formatting, language and overall presentation of the post?","question_id":"dev-1","answers":[{"answer":"The quality of the post is fantastic.","answer_id":"dev-1-a-1","value":10},{"answer":"The post is of very good quality. ","answer_id":"dev-1-a-2","value":8},{"answer":"The post is poorly written and/or formatted, but readable.","answer_id":"dev-1-a-3","value":3},{"answer":"The post is really hard to read and the content is barely understandable.","answer_id":"dev-1-a-4","value":0}]},{"question":"How would you rate the impact and significance of the contribution to the project and/or open source ecosystem in terms of uniqueness, usefulness and potential future applications?","question_id":"dev-2","answers":[{"answer":"This contribution adds high value and holds great significance for the project and/or open source ecosystem.","answer_id":"dev-2-a-1","value":35},{"answer":"This contribution adds significant value to the project and/or open source ecosystem. ","answer_id":"dev-2-a-2","value":28},{"answer":"This contribution adds some value to the project and/or open source ecosystem.","answer_id":"dev-2-a-3","value":17.5},{"answer":"This contribution hold no value and is insignificant in impact. ","answer_id":"dev-2-a-4","value":0}]},{"question":"How would you rate the total volume of work invested into this contribution?","question_id":"dev-3","answers":[{"answer":"This contribution appears to have demanded a lot of intensive work.","answer_id":"dev-3-a-1","value":20},{"answer":"This contribution appears to have required an average volume of work.","answer_id":"dev-3-a-2","value":14},{"answer":"This contribution shows some work done.","answer_id":"dev-3-a-3","value":6},{"answer":"This contribution shows no work done.","answer_id":"dev-3-a-4","value":0}]},{"question":"How would you rate the quality of the code submitted?","question_id":"dev-4","answers":[{"answer":"High - it follows all best practices. ","answer_id":"dev-4-a-1","value":20},{"answer":"Average - it follows most best practices.","answer_id":"dev-4-a-2","value":14},{"answer":"Low - it follows some best practices.","answer_id":"dev-4-a-3","value":6},{"answer":"Very low - it doesn't follow any best practices. ","answer_id":"dev-4-a-4","value":0}]},{"question":"How would you rate the knowledge and expertise necessary to fix the bug / implement the added feature(s)?","question_id":"dev-5","answers":[{"answer":"High - a lot of research and specific knowledge was required.","answer_id":"dev-5-a-1","value":7.5},{"answer":"Average - some research and knowledge was required.","answer_id":"dev-5-a-2","value":5.25},{"answer":"Low - not much knowledge or skill were required.","answer_id":"dev-5-a-3","value":2.25},{"answer":"Insignificant - no knowledge or skills were necessary.","answer_id":"dev-5-a-4","value":0}]},{"question":"How would you rate the accuracy and readability of the commit messages?","question_id":"dev-6","answers":[{"answer":"High - they are concise, descriptive and consistent. ","answer_id":"dev-6-a-1","value":2.5},{"answer":"Average - they are mostly concise, descriptive and consistent. ","answer_id":"dev-6-a-2","value":2},{"answer":"Low - they could be more concise, descriptive or consistent.","answer_id":"dev-6-a-3","value":0.75},{"answer":"Very low - they aren't concise, descriptive or consistent at all.","answer_id":"dev-6-a-4","value":0}]},{"question":"How do you rate the quality of the comments in the code?","question_id":"dev-7","answers":[{"answer":"High - everything is well-commented and adds to the readability of the code. ","answer_id":"dev-7-a-1","value":5},{"answer":"Average - most of the code is commented and most if it adds to the readability of the code.","answer_id":"dev-7-a-2","value":3},{"answer":"Low - little of the code is commented, but it still adds to the readability.","answer_id":"dev-7-a-3","value":1.5},{"answer":"Very low - the added comments provide no value or are not present at all.","answer_id":"dev-7-a-4","value":0}]}]}}"
created2018-04-25 07:00:21
last_update2018-04-25 14:47:27
depth0
children7
last_payout2018-05-02 07:00:21
cashout_time1969-12-31 23:59:59
total_payout_value150.228 HBD
curator_payout_value56.170 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,363
author_reputation27,763,618,634,121
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries
0.
accountutopian.pay
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,009,927
net_rshares35,905,853,288,947
author_curate_reward""
vote details (345)
@cnbuddy ·
你好!cn区点赞机器人 @cnbuddy 这厢有礼了。如果不想再收到我的留言,请回复“取消”。
properties (22)
authorcnbuddy
permlinkre-superoo7-statbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes-20180425t072558570z
categoryutopian-io
json_metadata""
created2018-04-25 07:25:57
last_update2018-04-25 07:25:57
depth1
children0
last_payout2018-05-02 07:25:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length47
author_reputation-1,449,160,991,441
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,013,463
net_rshares0
@justyy ·
$0.06
Thank you for you contribution.

----------------------------------------------------------------------
Need help? Write a ticket on https://support.utopian.io.
Chat with us on [Discord](https://discord.gg/uTyJkNm).

**[[utopian-moderator]](https://utopian.io/moderators)**
👍  , , , , ,
properties (23)
authorjustyy
permlinkre-superoo7-statbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes-20180425t144709267z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-04-25 14:47:09
last_update2018-04-25 14:47:09
depth1
children1
last_payout2018-05-02 14:47:09
cashout_time1969-12-31 23:59:59
total_payout_value0.058 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length273
author_reputation280,616,224,641,976
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries
0.
accountutopian.pay
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,079,283
net_rshares13,788,246,032
author_curate_reward""
vote details (6)
@superoo7 ·
Thank you moderator.
properties (22)
authorsuperoo7
permlinkre-justyy-re-superoo7-statbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes-20180426t005657976z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-04-26 00:56:51
last_update2018-04-26 00:56:51
depth2
children0
last_payout2018-05-03 00:56:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length20
author_reputation27,763,618,634,121
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,160,658
net_rshares0
@teammalaysia ·
$1.44
#### This post has been curated by **TeamMalaysia** Community :- 
To support the growth of TeamMalaysia Follow our upvotes by using **steemauto.com** and follow trail of @myach

Vote **TeamMalaysia** witness bitrocker2020 using this link <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=bitrocker2020&approve=true">vote for witness</a>
👍  
properties (23)
authorteammalaysia
permlinkstatbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes
categoryutopian-io
json_metadata{"tags":["teammalaysiadevtest","teammalaysia"],"app":"stephard/0.1"}
created2018-04-25 07:51:03
last_update2018-04-25 07:51:03
depth1
children0
last_payout2018-05-02 07:51:03
cashout_time1969-12-31 23:59:59
total_payout_value1.082 HBD
curator_payout_value0.357 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length358
author_reputation197,980,348,668
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,016,950
net_rshares223,631,315,941
author_curate_reward""
vote details (1)
@utopian-io ·
### Hey @superoo7! Thank you for the great work you've done!
We're already looking forward to your next contribution!
#### Fully Decentralized Rewards
We hope you will take the time to share your expertise and knowledge by rating contributions made by others on Utopian.io to help us reward the best contributions together.
#### Utopian Witness!
<a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for Utopian Witness!</a> We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

**Want to chat? Join us on Discord https://discord.me/utopian-io**
properties (22)
authorutopian-io
permlinkre-superoo7-statbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes-20180427t090112707z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-04-27 09:01:12
last_update2018-04-27 09:01:12
depth1
children0
last_payout2018-05-04 09:01:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length688
author_reputation152,955,367,999,756
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,418,705
net_rshares0
@veenang ·
Awesome job bro !!! although i only understand 10% of your post!!  haha... cheers bro
properties (22)
authorveenang
permlinkre-superoo7-statbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes-20180425t105539841z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-04-25 10:55:51
last_update2018-04-25 10:55:51
depth1
children1
last_payout2018-05-02 10:55:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length85
author_reputation33,932,611,907,165
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,043,124
net_rshares0
@superoo7 ·
This is more like a development report haahaa, just look at the image and understand how it works can d hehe.
👍  
properties (23)
authorsuperoo7
permlinkre-veenang-re-superoo7-statbot-v2-0-0-update-complete-rewrite-and-discord-message-ui-changes-20180425t105641738z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-04-25 10:56:39
last_update2018-04-25 10:56:39
depth2
children0
last_payout2018-05-02 10:56:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length109
author_reputation27,763,618,634,121
root_title"statBot v2.0.0 update: Complete Rewrite and Discord Message UI changes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,043,243
net_rshares2,373,481,478
author_curate_reward""
vote details (1)