Improve consistency

This commit is contained in:
Yarmo Mackenbach 2021-03-25 14:33:58 +01:00
parent 358b4bbf8f
commit 5ea67c1e6f
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
2 changed files with 4 additions and 4 deletions

View file

@ -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: [],

View file

@ -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) => {