Skip to content

Commit

Permalink
Conversion Script fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SunburntRock89 committed May 16, 2023
1 parent f9d74e8 commit ea7eb66
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions conversionScript/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ const moveNumbers = async() => {

for (const number of allNumbers) {
try {
const preExist = toInsert.find(n => n.channelID === number.channel);
if (preExist) {
console.log("!!");
console.log(preExist);
}

toInsert.push({
number: number.id,
channelID: number.channel,
Expand Down Expand Up @@ -453,21 +459,29 @@ const moveVotes = async() => {
const rpool = await r.connectPool({
server: "localhost",
user: "admin",
password: "y4pYRcZ6UBMR",
password: "",
db: "DiscordTel",
});

await r.table("Numbers").get("03012103214").delete().run();
await r.table("Phonebook").get("03012103214").delete().run();
await r.table("Mailbox").get("03012103214").delete().run();

await r.table("Numbers").get("03015626666").delete().run();
await r.table("Phonebook").get("03015626666").delete().run();
await r.table("Mailbox").get("03015626666").delete().run();

await prisma.activeCalls.deleteMany();
await prisma.archivedCalls.deleteMany();
await prisma.numbers.deleteMany();
await prisma.blacklist.deleteMany();
await prisma.strikes.deleteMany();
await prisma.votes.deleteMany();
await prisma.accounts.deleteMany();
await prisma.phonebook.deleteMany();
await prisma.numbers.deleteMany();
await prisma.mailbox.deleteMany();
await prisma.callMessages.deleteMany();
await prisma.guildConfigs.deleteMany();
await prisma.phonebook.deleteMany();
await prisma.votes.deleteMany();


await moveNumbers();
Expand Down
2 changes: 1 addition & 1 deletion src/commands/standard/mailbox messages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, CommandInteraction, EmbedBuilder, EmbedField, MessageComponentInteraction } from "discord.js";
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, EmbedField, MessageComponentInteraction } from "discord.js";
import config from "../../config/config";
import { db } from "../../database/db";
import { client } from "../../dtel";
Expand Down

0 comments on commit ea7eb66

Please sign in to comment.