<commit_before>const rp = require('request-promise');
const covert = require('../../covert.js');
const updateGuildInfo = require('../events/update-guild-info.js');
const messageDefaultChannel = require('../utilities/message-default-channel.js');

module.exports = function(guild, bot_auth){
	
	/*	
	const sendWelcomeMessage = prefix => {
		let escaped_prefix = prefix.replace(/[^a-zA-Z0-9]/g, '\\$&');
		messageDefaultChannel(guild, `This server can now use stickers! Type **${escaped_prefix}commands** to get started.`);	
	}
	*/

	rp({
		method: 'POST',
		uri: `${covert.app_url}/api/guilds/`,
		body: {
			id: guild.id,
			guildName: guild.name,
			icon: guild.icon || null
		},
		headers: {Authorization: bot_auth},
		json: true
	})
	.then(() => {
		console.log(`Guild ${guild.id} added!`);
		// sendWelcomeMessage('$');
		updateGuildInfo(guild, bot_auth);
	})
	.catch(err => {

		if(err.statusCode != 409){
			console.error(err.message);
			return;
		}

		//Re-Activate guild, as it already exists within database
		rp({
			method: 'PATCH',
			uri: `${covert.app_url}/api/guilds/${guild.id}`,
			body: {isActive: true},
			headers: {Authorization: bot_auth},
			json: true
		})
		.then(res => {
			console.log(`Guild ${guild.id} activated!`);	
			sendWelcomeMessage(res.commandPrefix);
			updateGuildInfo(guild, bot_auth);
		})
		.catch(err => {
			console.error(err.message);
		});

	});
}<commit_msg>Remove call to undefined function<commit_after>const rp = require('request-promise');
const covert = require('../../covert.js');
const updateGuildInfo = require('../events/update-guild-info.js');
const messageDefaultChannel = require('../utilities/message-default-channel.js');

module.exports = function(guild, bot_auth){
	
	/*	
	const sendWelcomeMessage = prefix => {
		let escaped_prefix = prefix.replace(/[^a-zA-Z0-9]/g, '\\$&');
		messageDefaultChannel(guild, `This server can now use stickers! Type **${escaped_prefix}commands** to get started.`);	
	}
	*/

	rp({
		method: 'POST',
		uri: `${covert.app_url}/api/guilds/`,
		body: {
			id: guild.id,
			guildName: guild.name,
			icon: guild.icon || null
		},
		headers: {Authorization: bot_auth},
		json: true
	})
	.then(() => {
		console.log(`Guild ${guild.id} added!`);
		// sendWelcomeMessage('$');
		updateGuildInfo(guild, bot_auth);
	})
	.catch(err => {

		if(err.statusCode != 409){
			console.error(err.message);
			return;
		}

		//Re-Activate guild, as it already exists within database
		rp({
			method: 'PATCH',
			uri: `${covert.app_url}/api/guilds/${guild.id}`,
			body: {isActive: true},
			headers: {Authorization: bot_auth},
			json: true
		})
		.then(res => {
			console.log(`Guild ${guild.id} activated!`);	
			// sendWelcomeMessage(res.commandPrefix);
			updateGuildInfo(guild, bot_auth);
		})
		.catch(err => {
			console.error(err.message);
		});

	});
}
{'fraction_non_alphanumeric': 0.19047619047619047, 'fraction_numerical': 0.003527336860670194, 'mean_word_length': 3.774410774410774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2231493', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1018, 'n_words': 190}