Hello, so first and foremost, I am a noob when it comes to this stuff. I’m brand-spankin’ new to the world of chatbots and whatnot – so go easy on me when providing solutions. I’ve enlisted the help of ChatGPI to figure out how to resolve the issue. So, I’m using Google Sheets as the link or holder of the quotes (I don’t know how to phrase it). I followed ChatGPI’s instructions…
The instructions were:
- Create your spreadsheet
- In column A, place the quote, in B, insert info about the quote-giver
- Go to “Extensions” → “Apps Script”
- Replace existing code with:
function getRandomQuote() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
var randomRow = Math.floor(Math.random() * lastRow) + 1;
var quote = sheet.getRange(randomRow, 1).getValue();
var author = sheet.getRange(randomRow, 2).getValue();
return "Quote: " + quote + " - Author: " + author;
}
- Save, deploy, authorize, etc.
So far, so good. I get to the part where I need to input the code into Nightbot. I’m a little confused by what Nightbot wants me to do. But from what I’ve gathered, the “!addquote” command is specifically for mods.
!addcom -ul=mod !addquote add $(urlfetch https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec?quote=$(querystring))
I did that, but I kept getting the “-ul=mod !addquote [Response must be less than 400 characters]” error. ChatGPT told me to input this code for viewers under the “!quote” command.
!addcom !quote $(urlfetch https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec)
I got the “[Response must be less than 400 characters]” error.
ChatGPT provided these solutions to fix the error:
For the “!addquote” command only used by moderators:
!addcom -ul=mod !addquote $(urlfetch https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?quote=$(querystring))
For the “!quote” command used by viewers:
!addcom !quote $(urlfetch https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec)
The error I got for both commands was the 400-character error. I don’t know if it’s because my quotes are too long – I triple-checked to ensure that wasn’t the cause, and it seems like everything is fine – or what, but any solutions would be awesome. I might try and make a new document all together and see if that resolves the issue.
Sorry for the long post, but I wanted to be as thorough as possible. Let me know if there’s any additional information you need! I’ll happily provide it.