<commit_before>#python 3
#requires https://github.com/Rapptz/discord.py / "pip install discord.py"
#licensed under the MIT license. For more information view LICENSE.md

import discord
import asyncio
import os.path
import re


#CONFIG START -------
channelids = {
'123456789': [':thinking:', ':upside_down:'], 
'987654321': [':smile:', ':forgot_others:']
}
userids = {
'userid1': [':antoher:', ':someother_emoji:'], 
'userid2': [':andanotherone:', ':another_one:']
}
regexes = {'regexpattern1': [':emoji9:', ':emoji10:'], 
'pattern2': [':emoji11:', ':emoji12']
}
token = ''
#CONFIG END -------


client = discord.Client()

@client.event
async def on_ready():
	print('Logged in as')
	print(client.user.name)
	print(client.user.id)
	print('------')

@client.event
async def on_message(message):
	try:
		for key, value in userids:
			if (message.author.id == key):
				for emoji in value:
					client.add_reaction(message, emoji)
		
		for key, value in channelids:
			if (message.channel.id == key):
					for emoji in value:
						client.add_reaction(message, emoji)
		
		for key, value in regexes:
			if (re.match(key, message.content)):
				for emoji in value:
					client.add_reaction(message, emoji)
	except:
		print("Unexpected error:", sys.exc_info()[0])

if token:
	client.run(token)
else:
	client.run(input('Please input token: '))<commit_msg>clear token input to prevent token leaking<commit_after>#python 3
#requires https://github.com/Rapptz/discord.py / "pip install discord.py"
#licensed under the MIT license. For more information view LICENSE.md

import discord
import asyncio
import os.path
import re


#CONFIG START -------
channelids = {
'123456789': [':thinking:', ':upside_down:'], 
'987654321': [':smile:', ':forgot_others:']
}
userids = {
'userid1': [':antoher:', ':someother_emoji:'], 
'userid2': [':andanotherone:', ':another_one:']
}
regexes = {'regexpattern1': [':emoji9:', ':emoji10:'], 
'pattern2': [':emoji11:', ':emoji12']
}
token = ''
#CONFIG END -------


client = discord.Client()

@client.event
async def on_ready():
	print('Logged in as')
	print(client.user.name)
	print(client.user.id)
	print('------')

@client.event
async def on_message(message):
	try:
		for key, value in userids:
			if (message.author.id == key):
				for emoji in value:
					client.add_reaction(message, emoji)
		
		for key, value in channelids:
			if (message.channel.id == key):
					for emoji in value:
						client.add_reaction(message, emoji)
		
		for key, value in regexes:
			if (re.match(key, message.content)):
				for emoji in value:
					client.add_reaction(message, emoji)
	except:
		print("Unexpected error:", sys.exc_info()[0])

if token:
	client.run(token)
else:
	token = input('Please input token: ')
	os.system('cls' if os.name == 'nt' else 'clear')
	client.run(token)
{'fraction_non_alphanumeric': 0.17598566308243727, 'fraction_numerical': 0.022222222222222223, 'mean_word_length': 4.197392923649907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1416092', 'n_tokens_mistral': 1133, 'n_tokens_neox': 985, 'n_words': 256}