<commit_before>const { botOwnerId } = require('../config.json');

const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./data/sqlite.db');

module.exports = {
	name: 'init',
	description: 'Intializes the database',
	args: true,
	usage: '<database | server>',
	category: 'Administration',
	execute(message, args) {
		if (message.member.hasPermission('MANAGE_ROLES')) {
			const type = args[0];

			try	{

				if(message.channel.type === 'dm') {

					message.channel.send('Please do not use this command in DMs!');
					return;

				}
				if(type == 'database') {
					if(message.author.id != botOwnerId) {
						message.channel.send('"This is used to initialize the database.  If not initialized, ask the bot owner to run this command."');
						return;
					}
					db.run('CREATE TABLE IF NOT EXISTS server (serverID TEXT, moderatorID TEXT, moderationChannel TEXT, mutedRoleID TEXT)');

					message.channel.send('Database initialized successfully!');
					console.log('Database tables initialized.');
				}
				if(type == 'server') {
					db.run('INSERT INTO server (serverID) VALUES (?)', message.guild.id);<commit_msg>(minor) Applying PK on SQL database so no duplicates would be allowed.<commit_after>const { botOwnerId } = require('../config.json');

const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./data/sqlite.db');

module.exports = {
	name: 'init',
	description: 'Intializes the database',
	args: true,
	usage: '<database | server>',
	category: 'Administration',
	execute(message, args) {
		if (message.member.hasPermission('MANAGE_ROLES')) {
			const type = args[0];

			try	{

				if(message.channel.type === 'dm') {

					message.channel.send('Please do not use this command in DMs!');
					return;

				}
				if(type == 'database') {
					if(message.author.id != botOwnerId) {
						message.channel.send('"This is used to initialize the database.  If not initialized, ask the bot owner to run this command."');
						return;
					}
					db.run('CREATE TABLE IF NOT EXISTS server (serverID TEXT, moderatorID TEXT, moderationChannel TEXT, mutedRoleID TEXT, PRIMARY KEY(serverID)');

					message.channel.send('Database initialized successfully!');
					console.log('Database tables initialized.');
				}
				if(type == 'server') {
					db.run('INSERT INTO server (serverID) VALUES (?)', message.guild.id);
{'fraction_non_alphanumeric': 0.14778947368421053, 'fraction_numerical': 0.003368421052631579, 'mean_word_length': 3.7615230460921842, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '605957', 'n_tokens_mistral': 853, 'n_tokens_neox': 705, 'n_words': 200}