<commit_before># Pybot
Bot for Slack built in Python

This is a side project of mine, which hopefully will make it easy to keep track of ideas my team has for upcoming hackathons.
Feel free to use my code, but please credit me (preferably via direct link to this repo). I try to comment it where possible.
If you would like to make a pull request, please make it to "usbot.py". "bot.py" is my stable build.

If you want to add it to your own Slack channel, create cfg.py and set TOKEN to be a string of your bot's token. You might have to change some of the userIDs in the main code, I'll get around to making that easier someday.

# Usage

### !idea: \<text\>

Enters an idea. Make sure there is a space after the colon


### !getideas \<name\>

Gets an idea. Make sure the name matches the person's first name (if they haven't set one, their Slack username) as of the bot's last restart.
Make sure there is a space between the command and the person's name.


### !delidea \<*n*\>

Deletes the *n*th idea in your list of ideas. It is reccommended to call !getideas first.

### !machineinfo

Displays information about the machine running the bot

# New since v3.2.1

### New Features
* Bot now waits 5 minutes when restarting
* Error log

### Fixes
* Cleaned up existing code
* Killed useless code
* Made error handling better
* Bot no longer wipes text files when Zalgo text is input<commit_msg>The README update that should've happened ages ago<commit_after># Pybot
Bot for Slack built in Python

This is a side project of mine, which hopefully will make it easy to keep track of ideas my team has for upcoming hackathons.
Feel free to use my code, but please credit me (preferably via direct link to this repo). I try to comment it where possible.
If you would like to make a pull request, please make it to the "unstable" branch. The master branch is my stable build.

# Usage

### !idea: \<text\>

Enters an idea. Make sure there is a space after the colon


### !getideas \<name\>

Gets an idea. Make sure the name matches the person's first name (if they haven't set one, their Slack username) as of the bot's last restart.
Make sure there is a space between the command and the person's name.


### !delidea \<*n*\>

Deletes the *n*th idea in your list of ideas. It is reccommended to call !getideas first.

### !machineinfo

Displays information about the machine running the bot

# Setup instructions

Place bot.py in whichever folder you want it to run in. Note that it creates multiple text files, so putting it in a folder would be recommended.
Create a file named "cfg.py" in the same folder. The file should look like this:

```Python
TOKEN = "<redacted>"
USTOKEN = "<redacted>"
CHANNEL = "ideas"
DEBUGMODE = True
DEBUGCH = "pybotdebug"
```

Note that you only need the USTOKEN variable if you will be running the unstable build. If DEBUGMODE is set to False, you do not need to set DEBUGCH

# New since v3.3

### New Features
* Channel for bot to listen/post is now configurable
{'fraction_non_alphanumeric': 0.0657543391188251, 'fraction_numerical': 0.0020026702269692926, 'mean_word_length': 3.8573743922204216, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3415887', 'n_tokens_mistral': 876, 'n_tokens_neox': 831, 'n_words': 505}