<commit_before>import asyncio, re, logging, json, random
import hangups
import plugins

logger = logging.getLogger(__name__)

def _initialise(bot):
   plugins.register_user_command(["botdoc"])
   plugins.register_admin_command(["setbotdoc"])
   
@asyncio.coroutine
def botdoc(bot, event, *args):
   """Shows the bot related documentation"""
   text = bot.user_memory_get('botdocmemory', 'botdoc')
   if text is None:
      message = u'There is no documentation for this HO bot! :(' % (event.user.full_name, name)
   else:
      message = u'%s' % (text)
   yield from bot.coro_send_message(event.conv,message)

@asyncio.coroutine
def setbotdoc(bot, event, *args):
   """Set the botdoc message. Only admins can set the botdoc message. With /bot setbotdoc clear you can clear the botdoc message."""
   parameters = list(args)
   if parameters[0] == "clear":
      bot.user_memory_set('botdocmemory', 'botdoc', None)
   else: 
      bot.user_memory_set('botdocmemory', 'botdoc', ' '.join(args))
      text = bot.user_memory_get('botdocmemory', 'botdoc')
      message = u'Botdoc message stored: %s' % (text)
      yield from bot.coro_send_message(event.conv,message)<commit_msg>Update botdoc.py<commit_after>import asyncio, re, logging, json, random
import hangups
import plugins

logger = logging.getLogger(__name__)

def _initialise(bot):
   plugins.register_user_command(["botdoc"])
   plugins.register_admin_command(["setbotdoc"])
   
@asyncio.coroutine
def botdoc(bot, event, *args):
   """Shows the bot related documentation"""
   if not bot.memory.exists(['botdoc']):
      bot.memory.set_by_path(['botdoc'], {})
   
   text = bot.user_memory_get('botdocmemory', 'botdoc')
   #if not bot.memory.exists(['tldr']):
   if text is None:
      message = u'There is no documentation for this HO bot! :('
   else:
      message = u'%s' % (text)
   yield from bot.coro_send_message(event.conv,message)

@asyncio.coroutine
def setbotdoc(bot, event, *args):
   """Set the botdoc message. Only admins can set the botdoc message. With /bot setbotdoc clear you can clear the botdoc message."""
   parameters = list(args)
   if parameters[0] == "clear":
      bot.user_memory_set('botdocmemory', 'botdoc', None)
      message = u'Botdoc message CEARED'
   else: 
      bot.user_memory_set('botdocmemory', 'botdoc', ' '.join(args))
      text = bot.user_memory_get('botdocmemory', 'botdoc')
      message = u'Botdoc message stored: %s' % (text)
   yield from bot.coro_send_message(event.conv,message)
{'fraction_non_alphanumeric': 0.13263665594855306, 'fraction_numerical': 0.0008038585209003215, 'mean_word_length': 4.318376068376068, 'pattern_counts': {'":': 2, '<': 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': '4094087', 'n_tokens_mistral': 810, 'n_tokens_neox': 811, 'n_words': 211}