Development (#13)

Co-authored-by: PineaFan <ash@pinea.dev>
Co-authored-by: pineafan <pineapplefanyt@gmail.com>
Co-authored-by: PineappleFan <PineaFan@users.noreply.github.com>
Co-authored-by: Skyler <skyler3665@gmail.com>
pull/17/head
Samuel Shuert 3 years ago committed by GitHub
parent cc63dee71e
commit 3621bf9afe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -330,7 +330,6 @@ const callback = async (interaction: CommandInteraction): Promise<unknown> => {
],
components: [
new Discord.ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder().setLabel("View").setStyle(ButtonStyle.Link).setURL(`https://clicks.codes/nucleus/transcript/${code}?key=${key}&iv=${iv}`).setDisabled(!code),
])

@ -183,7 +183,6 @@ const callback = async (interaction: CommandInteraction): Promise<void> => {
await client.database.history.delete(interaction.guild!.id);
await client.database.notes.delete(interaction.guild!.id);
await client.database.transcripts.deleteAll(interaction.guild!.id);
nextFooter = "All data cleared";
continue;
} else {

@ -15,11 +15,9 @@ declare const config: {
password: string,
database: string,
host: string,
authSource: string
},
baseUrl: string,
pastebinApiKey: string,
pastebinUsername: string,
pastebinPassword: string,
rapidApiKey: string
};

@ -206,9 +206,7 @@ const callback = async (interaction: MessageContextMenuCommandInteraction) => {
],
components: [
new Discord.ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder().setLabel("View").setStyle(ButtonStyle.Link).setURL(`https://clicks.codes/nucleus/transcript/${code}?key=${key}&iv=${iv}`).setDisabled(!code),
])
]
});

@ -60,9 +60,7 @@ export default async function (interaction: CommandInteraction | MessageComponen
const newOut = await client.database.transcripts.createTranscript(messages, interaction, member);
const [code, key, iv] = await client.database.transcripts.create(newOut);
if(!code) return await interaction.reply({
embeds: [
new EmojiEmbed()
@ -88,9 +86,7 @@ export default async function (interaction: CommandInteraction | MessageComponen
],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder().setLabel("View").setStyle(ButtonStyle.Link).setURL(`https://testing.coded.codes/nucleus/transcript/${code}?key=${key}&iv=${iv}`),
new ButtonBuilder()
.setLabel("Delete")
.setStyle(ButtonStyle.Danger)

@ -6,22 +6,14 @@ import client from "../utils/client.js";
import * as crypto from "crypto";
import _ from "lodash";
import defaultData from '../config/default.js';
// config.mongoOptions.host, {
// auth: {
// username: config.mongoOptions.username,
// password: config.mongoOptions.password
// },
// authSource: config.mongoOptions.authSource
// }
// mongodb://emails:SweetLife2023!!@127.0.0.1:28180/saveEmail?retryWrites=true&w=majority
const username = encodeURIComponent(config.mongoOptions.username);
const password = encodeURIComponent(config.mongoOptions.password);
const mongoClient = new MongoClient(username ? `mongodb://${username}:${password}@${config.mongoOptions.host}` : `mongodb://${config.mongoOptions.host}`, {authSource: "admin"});
const mongoClient = new MongoClient(username ? `mongodb://${username}:${password}@${config.mongoOptions.host}?authMechanism=DEFAULT` : `mongodb://${config.mongoOptions.host}`, {authSource: "admin"});
await mongoClient.connect();
const database = mongoClient.db();
const collectionOptions = { authdb: "admin" };
const getIV = () => crypto.randomBytes(16);
@ -542,7 +534,6 @@ export class Premium {
const entry = await this.premium.findOne({ user: user });
return entry ? true : false;
}
async createUser(user: string, level: number) {
// console.log("Premium createUser");
await this.premium.insertOne({ user: user, appliesTo: [], level: level }, collectionOptions);

@ -79,7 +79,10 @@ export const Logger = {
},
async log(log: LoggerOptions): Promise<void> {
if (!await isLogging(log.hidden.guild, log.meta.calculateType)) return;
console.log(log.hidden.guild)
const config = await client.database.guilds.read(log.hidden.guild);
console.log(config.logging.logs.channel)
if (config.logging.logs.channel) {
const channel = (await client.channels.fetch(config.logging.logs.channel)) as Discord.TextChannel | null;
const description: Record<string, string> = {};

Loading…
Cancel
Save