Compare commits

...

19 commits

Author SHA1 Message Date
Niko
b845c8099b
Merge pull request #22 from lbryio/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2020-08-19 03:59:12 +02:00
dependabot[bot]
7bba35a7f5
Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-17 11:37:10 +00:00
Thomas Zarebczan
ba1ca3bce1
Merge pull request #21 from eatdostacos/patch-1
Updated readme.md
2020-05-24 10:08:58 -04:00
eatdostacos
093a8fe67c
Updated readme.md 2020-05-23 22:46:11 -07:00
Niko
7a4509fb90
Merge pull request #20 from lbryio/dependabot/npm_and_yarn/lodash-4.17.15
Bump lodash from 4.17.10 to 4.17.15
2019-10-14 10:08:54 -04:00
Niko
b32f5eceb1
Merge pull request #19 from lbryio/dependabot/npm_and_yarn/extend-3.0.2
Bump extend from 3.0.1 to 3.0.2
2019-10-14 10:08:28 -04:00
dependabot[bot]
1fd5440499
Bump lodash from 4.17.10 to 4.17.15
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.10...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-10 20:16:34 +00:00
dependabot[bot]
d95b24be92
Bump extend from 3.0.1 to 3.0.2
Bumps [extend](https://github.com/justmoon/node-extend) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/justmoon/node-extend/releases)
- [Changelog](https://github.com/justmoon/node-extend/blob/master/CHANGELOG.md)
- [Commits](https://github.com/justmoon/node-extend/compare/v3.0.1...v3.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-10 20:16:31 +00:00
Niko Storni
748d202a01 Merge branch 'mention_fix' 2019-10-10 22:15:21 +02:00
Niko Storni
3f3bc693a0 use .com 2019-10-10 22:15:07 +02:00
Jeremy Kauffman
804c7aed91
bot mention fix 2019-10-10 14:57:25 -04:00
filipnyquist
6bc58da4c0
Merge pull request #14 from lbryio/tip-fix-newlines
Replaced newline chars with spaces, this will parse the messages corr…
2018-08-04 11:35:58 +02:00
filipnyquist
b028aaf45f Replaced newline chars with spaces, this will parse the messages correctly even if newlines are in the tweet, fixes #10. 2018-08-04 11:35:07 +02:00
filipnyquist
684011e2b6
Merge pull request #12 from lbryio/deposit-msg
remove period from deposit tweet for easier copy/paste
2018-07-20 18:47:56 +02:00
Jeremy Kauffman
9f17bc5b07
remove period from deposit tweet for easier copy/paste 2018-07-20 11:09:25 -04:00
filipnyquist
e16d827cec Fixed message size 2018-07-06 16:55:53 +02:00
filipnyquist
d88df331f1 Fixed message size 2018-07-06 16:45:30 +02:00
filipnyquist
b3a70dde59 Fixed message size 2018-07-06 16:29:35 +02:00
filipnyquist
05dc97bda8
Merge pull request #9 from lbryio/next-tipbot
Latest version of tipbot, rewritten and solving most of the issues.
2018-07-06 15:52:08 +02:00
3 changed files with 19 additions and 21 deletions

View file

@ -31,16 +31,16 @@ node move_helper.js
## Contributing ## Contributing
Contributions to this project are welcome, encouraged, and compensated. For more details, see [lbry.io/faq/contributing](https://lbry.io/faq/contributing) Contributions to this project are welcome, encouraged, and compensated. For more details, see [lbry.tech/contribute](https://lbry.tech/contribute)
## License ## License
This project is MIT Licensed &copy; [LBRYio](https://github.com/lbryio) This project is MIT Licensed &copy; [LBRYio](https://github.com/lbryio)
## Security ## Security
We take security seriously. Please contact security@lbry.io regarding any security issues. We take security seriously. Please contact security@lbry.com regarding any security issues.
Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it.
## Contact ## Contact
The primary contact for this project is [@filipnyquist](https://github.com/filipnyquist) (filip@lbry.io) The primary contact for this project is [@filipnyquist](https://github.com/filipnyquist) (filip@lbry.com)

View file

@ -42,7 +42,7 @@ logger.info("Started LBRY twitter tipbot.");
stream.on("tweet", function(tweet) { stream.on("tweet", function(tweet) {
if(tweet.user.screen_name === config.get("bot.handle").substring(1)) return; if(tweet.user.screen_name === config.get("bot.handle").substring(1)) return;
let msg = checkTrunc(tweet); let msg = checkTrunc(tweet);
msg = msg.slice(msg.indexOf(config.get("bot.handle"))).split(" "); msg = msg.replace(/[\n\\]/g, " ").slice(msg.lastIndexOf(config.get("bot.handle"))).split(" ");
if (msg.length >= 2) checkTweet(tweet, msg); if (msg.length >= 2) checkTweet(tweet, msg);
}); });
@ -78,13 +78,13 @@ async function doHelp(tweet, msg) {
let post = await T.post("statuses/update", { let post = await T.post("statuses/update", {
status: status:
`@${tweet.user.screen_name} `+ `@${tweet.user.screen_name} `+
`All commands should be called with ${config.get("bot.handle")} + subcommand \n` + `Call commands with: ${config.get("bot.handle")} + \n` +
"help - Shows this command. \n" + "help - Shows this command.\n" +
"balance - Get your balance. \n" + "balance - Get your balance.\n" +
"deposit - Get address for your deposits. \n" + "deposit - Get address for your deposits.\n" +
"withdraw ADDRESS AMOUNT - Withdraw AMOUNT credits to ADDRESS. \n" + "withdraw ADDRESS AMOUNT - Withdraw AMOUNT credits to ADDRESS.\n" +
"tip USER AMOUNT - Tip USER AMOUNT.\n"+ "tip USER AMOUNT - Tip USER AMOUNT.\n"+
"terms - Sends you the TOS.", "terms - Sends the TOS.",
in_reply_to_status_id: tweet.id_str in_reply_to_status_id: tweet.id_str
}); });
logger.info( logger.info(
@ -123,7 +123,7 @@ async function doBalance(tweet, msg) {
async function doDeposit(tweet, msg) { async function doDeposit(tweet, msg) {
try { try {
const post = await T.post("statuses/update", { const post = await T.post("statuses/update", {
status: `@${tweet.user.screen_name} Your deposit address is ${await getAddress(id(tweet.user.id_str))}.`, status: `@${tweet.user.screen_name} Your deposit address is ${await getAddress(id(tweet.user.id_str))}`,
in_reply_to_status_id: tweet.id_str in_reply_to_status_id: tweet.id_str
}); });
logger.info( logger.info(
@ -189,9 +189,7 @@ async function doTip(tweet, msg) {
} }
const txId = await lbry.sendFrom(id(tweet.user.id_str), tipToAddress, Number(amount), 1); const txId = await lbry.sendFrom(id(tweet.user.id_str), tipToAddress, Number(amount), 1);
await T.post("statuses/update", { await T.post("statuses/update", {
status: `@${tweet.user.screen_name} Tipped ${ status: `@${tweet.user.screen_name} Tipped ${amount} LBC! We'd say who it was to, but then Twitter would ban the bot. \nTransaction: ${txLink(txId)} \nSee https://lbry.com/faq/tipbot-twitter for more information.`,
msg[2]
} ${amount} LBC! \nTransaction: ${txLink(txId)} \nSee https://lbry.io/faq/tipbot-twitter for more information.`,
in_reply_to_status_id: tweet.id_str in_reply_to_status_id: tweet.id_str
}); });
logger.info( logger.info(
@ -223,7 +221,7 @@ function getValidatedAmount(amount) {
return amount.match(/^[0-9]+(\.[0-9]+)?$/) ? amount : null; return amount.match(/^[0-9]+(\.[0-9]+)?$/) ? amount : null;
} }
function txLink(txId) { function txLink(txId) {
return `https://explorer.lbry.io/tx/${txId}`; return `https://explorer.lbry.com/tx/${txId}`;
} }
function checkTrunc(tweet) { function checkTrunc(tweet) {
if (tweet.truncated) return tweet.extended_tweet.full_text; if (tweet.truncated) return tweet.extended_tweet.full_text;

View file

@ -213,8 +213,8 @@ env-variable@0.0.x:
resolved "https://registry.yarnpkg.com/env-variable/-/env-variable-0.0.4.tgz#0d6280cf507d84242befe35a512b5ae4be77c54e" resolved "https://registry.yarnpkg.com/env-variable/-/env-variable-0.0.4.tgz#0d6280cf507d84242befe35a512b5ae4be77c54e"
extend@~3.0.1: extend@~3.0.1:
version "3.0.1" version "3.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
extsprintf@1.3.0: extsprintf@1.3.0:
version "1.3.0" version "1.3.0"
@ -362,8 +362,8 @@ kuler@0.0.x:
colornames "0.0.2" colornames "0.0.2"
lodash@^4.0.0, lodash@^4.17.10: lodash@^4.0.0, lodash@^4.17.10:
version "4.17.10" version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
logform@^1.6.0, logform@^1.9.0: logform@^1.6.0, logform@^1.9.0:
version "1.9.1" version "1.9.1"