Skip to content

Commit e08599d

Browse files
committed
no code snippet extracting for now
1 parent 733f0b8 commit e08599d

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

bot.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function prepareDatabase()
3131
// should we care about which server it came from as well, for the sake of generality?
3232
// even if it's only intended to be used on one server?
3333
assertTable("Message", ["msgId", "channel", "author"]);
34-
assertTable("Content", ["fullMessage", "codeSnippet", "date", "language", "associatedMsg"]);
34+
assertTable("Content", ["fullMessage", "date", "associatedMsg"]);
3535
};
3636

3737
// close the database if its open
@@ -80,20 +80,8 @@ function createEntry(message)
8080
// add a revision to a message in the database
8181
function storeRevision(message)
8282
{
83-
// i'm not sure how we should handle multiple code snippets per message yet
84-
// so for now i'll just add separate row per snippet
85-
// (they are associated by timestamp)
86-
// also i'm assuming "date" column should be a universal time stamp
87-
// (but we can change it to a formatted date if that was the intention)
88-
getCodeBlocks(message.content).forEach(block =>
89-
insertRow("Content", [message.content, block.code,
90-
getLatestTimestamp(message), block.lang, message.id]));
91-
92-
// i'm not sure what to do with urls at the moment,
93-
// so i'll just stuff them in the same row for now
94-
getLinks(message.content).forEach(link =>
95-
insertRow("Content", [message.content, link,
96-
getLatestTimestamp(message), null, message.id]));
83+
// store this revision of the message
84+
insertRow("Content", [message.content, getLatestTimestamp(message), message.id]);
9785
}
9886

9987
// tab over newlines

0 commit comments

Comments
 (0)