<commit_before>import praw
import time

#What to tell reddit my bot is called.
user_agent = ("/r/ithkuil Lookup Bot 1.0 by /u/Archare")
#The reddit object
r = praw.Reddit(user_agent=user_agent)

#Login to reddit. No username or pass is given, so will prompt stdin.
r.login(username='IthkuilHelpBot')

#Get the abbreviations from an accompanying csv file.
import csv
#Opens the csv containing Ithkuil abbreviations to a file object.
abbrev = {}
with open('shortab.csv') as f:
    reader = csv.reader(f)
    for row in reader:
        # row[0] is the abbrev, row[1] is the map.
        abbrev[row[0]] = row[1]

#The main loop
while True:
    submission = r.get_submission(submission_id='2t4ruz')
    flat_comment = praw.helpers.flatten_tree(submission.comments)
    for comment in flat_comment:
        if comment

    time.sleep(10)<commit_msg>Added the main logic. Does not work b/c Unicode.<commit_after>import praw
import time

#The strings that will 'summon' the bot:
summonstring = '!ithkuil'

#What to tell reddit my bot is called.
user_agent = ("/r/ithkuil Lookup Bot 1.0 by /u/Archare")
#The reddit object
r = praw.Reddit(user_agent=user_agent)

#Login to reddit. No username or pass is given, so will prompt stdin.
r.login(username='IthkuilHelpBot')

#Get the abbreviations from an accompanying csv file.
import csv
#Opens the csv containing Ithkuil abbreviations to a file object.
abbrev = {}
with open('shortab.csv') as f:
    reader = csv.reader(f)
    for row in reader:
        # row[0] is the abbrev, row[1] is the map.
        abbrev[row[0]] = row[1]
#The set of all comments already replied to.
already_done = set()

#The main loop
while True:
    submission = r.get_submission(submission_id='2vxmak')
    flat_comment = praw.helpers.flatten_tree(submission.comments)
    for comment in flat_comment:
        #Finds the string used to invoke the bot.
        if summonstring in comment.body:
            #Creates a list of potential 'keys'
            keys = comment.body.split()
            for word in keys:
                if word in abbrev:
                    comment.reply(abbrev(word))
            already_done.add(comment.id)
    time.sleep(10)
{'fraction_non_alphanumeric': 0.09363468634686346, 'fraction_numerical': 0.008763837638376383, 'mean_word_length': 3.219844357976654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '451156', 'n_tokens_mistral': 733, 'n_tokens_neox': 702, 'n_words': 244}