Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1021726 // dm_discord_gatherFeedbackFromLine

JavaX fragment (include)

svoid dm_discord_gatherFeedbackFromLine(GazelleLine l) pcall {
  S mrStruct = gazelle_discord_matchedRuleStructForMsgID(l.msgID);
  if (mrStruct == null) ret; // with print("Not a Gazelle line or legacy");
  print("Processing: " + l.msgID + " - " + l.text);
  printIndent(shorten(mrStruct, 50));
  printIndent(l.reactions);
  LS posNeg = uniquifyCI(map dm_posNegStringForEmoji(collectStrings emoji(l.reactions)));
  printIndent("posNeg = " + posNeg);
  if (l(posNeg) > 1) ret with warn("  Mixed feedback, skipping");
  S judgement = cic(posNeg, 'positive) ? 'good : 'bad;
  dm_gazelle_saveAppliedRule(
    +judgement,
    matchedRuleStruct := mrStruct,
    context := "discord msg " + l.msgID);
}

Author comment

Began life as a copy of #1021709

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021726
Snippet name: dm_discord_gatherFeedbackFromLine
Eternal ID of this version: #1021726/4
Text MD5: 2c4899be2f7faf35bb274a27f3a4bb44
Author: stefan
Category: javax / discord / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 21:41:09
Source code size: 710 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 232 / 280
Version history: 3 change(s)
Referenced in: [show references]