mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-23 15:09:28 -07:00
Improve consistency
This commit is contained in:
parent
358b4bbf8f
commit
5ea67c1e6f
2 changed files with 4 additions and 4 deletions
|
@ -15,10 +15,10 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
const irc = require('irc-upd')
|
const irc = require('irc-upd')
|
||||||
|
|
||||||
module.exports = async (serverHostname, nickQuery, nickLogin) => {
|
module.exports = async (nickQuery, opts) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const client = new irc.Client(serverHostname, nickLogin, {
|
const client = new irc.Client(opts.hostname, opts.nick, {
|
||||||
port: 6697,
|
port: 6697,
|
||||||
secure: true,
|
secure: true,
|
||||||
channels: [],
|
channels: [],
|
||||||
|
|
|
@ -16,13 +16,13 @@ limitations under the License.
|
||||||
const bent = require('bent')
|
const bent = require('bent')
|
||||||
const bentReq = bent('GET')
|
const bentReq = bent('GET')
|
||||||
|
|
||||||
module.exports = async (tweetId, bearerToken) => {
|
module.exports = async (tweetId, opts) => {
|
||||||
return bentReq(
|
return bentReq(
|
||||||
`https://api.twitter.com/1.1/statuses/show.json?id=${tweetId}&tweet_mode=extended`,
|
`https://api.twitter.com/1.1/statuses/show.json?id=${tweetId}&tweet_mode=extended`,
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
Authorization: `Bearer ${bearerToken}`,
|
Authorization: `Bearer ${opts.bearerToken}`,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async (data) => {
|
.then(async (data) => {
|
||||||
|
|
Loading…
Reference in a new issue