Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
LBRY Bot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Melroy van den Berg
LBRY Bot
Commits
7fe3052c
Commit
7fe3052c
authored
Oct 05, 2019
by
Melroy van den Berg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable thumb & fix LTC to LBC typo (sorry)
parent
34db8ed7
Pipeline
#1385
passed with stage
in 1 minute and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/telegram.js
src/telegram.js
+6
-7
No files found.
src/telegram.js
View file @
7fe3052c
...
...
@@ -180,7 +180,7 @@ Oldest address in keypool: ${oldestKeyTime}
this
.
bot
.
sendMessage
(
chatId
,
'
Error: Provide atleast the URI as argument: /file <uri>
'
)
})
// file
info
command (/file <uri>)
// file command (/file <uri>)
this
.
bot
.
onText
(
/
[/
|!
]
file@
?\S
*
(
.+
)
/
,
(
msg
,
match
)
=>
{
const
uri
=
match
[
1
].
trim
()
this
.
lbry
.
getMetaFileData
(
uri
)
...
...
@@ -197,7 +197,6 @@ Oldest address in keypool: ${oldestKeyTime}
const
durationSec
=
(((
parseFloat
(
result
.
metadata
.
video
.
duration
)
/
60
)
%
2
)
*
60
).
toFixed
(
0
)
duration
=
`\n*Duration:*
${
durationMin
}
m
${
durationSec
}
s`
}
const
thumbnail
=
result
.
metadata
.
thumbnail
.
url
const
fileSize
=
parseFloat
(
result
.
metadata
.
source
.
size
/
Math
.
pow
(
1024
,
2
)).
toFixed
(
2
)
// To Megabyte
const
uriWithoutProtocol
=
uri
.
replace
(
/
(
^
\w
+:|^
)\/\/
/
,
''
)
const
publicURL
=
LBRY_TV_URL
+
'
/
'
+
uriWithoutProtocol
...
...
@@ -209,7 +208,7 @@ Oldest address in keypool: ${oldestKeyTime}
[Watch Online!](
${
publicURL
}
)
[Watch via LBRY App](
${
OPEN_URL
}
/
${
uriWithoutProtocol
}
)`
this
.
bot
.
sendMessage
(
chatId
,
textMsg
,
{
parse_mode
:
'
markdown
'
})
if
(
thumbnail
)
{
this
.
bot
.
sendPhoto
(
chatId
,
thumbnai
l
,
{
caption
:
'
Thumbnail:
'
+
title
})
}
// Disable thumbnail: if (thumbnail) { this.bot.sendPhoto(chatId, result.metadata.thumbnail.ur
l, { caption: 'Thumbnail: ' + title }) }
})
.
catch
(
error
=>
{
console
.
error
(
error
)
...
...
@@ -291,10 +290,10 @@ Block reward 24 hours avg: ${exchangeResult.block_reward24} LBC
Block reward 3 days avg:
${
exchangeResult
.
block_reward3
}
LBC
*Exchange* 💱
Exchange rate:
${
exchangeRate
}
BTC-L
T
C
Exchange rate 24 hours avg:
${
exchangeRate24h
}
BTC-L
T
C
Exchange rate 3 days avg:
${
exchangeRate3d
}
BTC-L
T
C
Exchange rate 7 days avg:
${
exchangeRate7d
}
BTC-L
T
C`
Exchange rate:
${
exchangeRate
}
BTC-L
B
C
Exchange rate 24 hours avg:
${
exchangeRate24h
}
BTC-L
B
C
Exchange rate 3 days avg:
${
exchangeRate3d
}
BTC-L
B
C
Exchange rate 7 days avg:
${
exchangeRate7d
}
BTC-L
B
C`
this
.
bot
.
sendMessage
(
chatId
,
text
,
{
parse_mode
:
'
markdown
'
})
})
.
catch
(
error
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment