-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update scheduled.js #9
base: develop
Are you sure you want to change the base?
Conversation
Added changes to display link of the submissions when they exists.
src/scheduled.js
Outdated
event.reply(`${item.title} [${item.categories.join(' ')}] (${username}) ${item.guid}`); | ||
} | ||
else { | ||
event.reply(`${item.title} {${item.link}} [${item.categories.join(' ')}] (${username}) ${item.guid}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check the length of the message before we send it? I feel like adding the URL can create a message that's too long for IRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulling the maximum lengths from the schema.rb, we have an upper bound of 707 characters. IRC's max length is 510.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay yes. In that case we need to add checks for length. I'll make the necessary changes. Please do make sure to run some tests on them since I am not familiar with javascript
Edit: @hmadison I just added a new commit that checks if length of reply is greater than 510. I hope this is correct. If it needs some change, please let me know :)
One other idea I had in mind was to use some sort of URL shortnening service. Although they all required paid plans and seemed a bit too much. If its interests you, I can also look it up :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git.io should work if desired - https://github.blog/2011-11-10-git-io-github-url-shortener/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@winks git.io
is for GitHub controlled properties.
Added check for length of the reply. Reply string should not be > 510 characters according to IRC spec.
Hey @unbeschwert, would it be possible to get the test added we discussed on IRC so I can merge this? |
Added changes to display link of the submissions when they exists.