add await

This commit is contained in:
kdh8219 2023-06-12 00:30:25 +09:00
parent 08569c1b41
commit eea6bb1316
Signed by: kdh8219
GPG key ID: 9B901BE907D1862E
4 changed files with 6 additions and 6 deletions

View file

@ -17,6 +17,6 @@ export default {
async execute(interaction: ChatInputCommandInteraction) {
const discord_id = interaction.user.id;
const mcid = interaction.options.getString("minecraft_id") as string;
add_user(interaction, discord_id, mcid, mojangAPI, firebase);
await add_user(interaction, discord_id, mcid, mojangAPI, firebase);
},
};

View file

@ -29,6 +29,6 @@ export default {
async execute(interaction: ChatInputCommandInteraction) {
const discord_id = interaction.options.getUser("discord")?.id as string;
const mcid = interaction.options.getString("minecraft_id") as string;
add_user(interaction, discord_id, mcid, mojangAPI, firebase);
await add_user(interaction, discord_id, mcid, mojangAPI, firebase);
},
};

View file

@ -28,7 +28,7 @@ client.once(Events.ClientReady, async (event) => {
try {
await guild.members.fetch(data.discord_id);
} catch {
doc.ref.delete();
await doc.ref.delete();
await send_embed(client, process.env.LOG_CHANNEL_ID, [
new EmbedBuilder()
.setTitle("Auto Removed")
@ -78,7 +78,7 @@ client.on(Events.GuildMemberRemove, async (interaction) => {
.get();
for (const doc of exited_user.docs) {
const data = doc.data() as TUser;
doc.ref.delete();
await doc.ref.delete();
await send_embed(client, process.env.LOG_CHANNEL_ID, [
new EmbedBuilder()
.setTitle("Auto Removed")

View file

@ -24,7 +24,7 @@ export class MojangAPI {
const get_by_id = await this.firestore.where("id", "==", id).get();
get_by_id.forEach((doc) => doc.ref.delete());
this.firestore.add({ uuid: minecraft_uuid, id: id });
await this.firestore.add({ uuid: minecraft_uuid, id: id });
this.cache.remove_by_second(id);
this.cache.set_by_first(minecraft_uuid, id);
@ -43,7 +43,7 @@ export class MojangAPI {
const get_by_uuid = await this.firestore.where("uuid", "==", uuid).get();
get_by_uuid.forEach((doc) => doc.ref.delete());
this.firestore.add({ uuid: uuid, id: minecraft_id });
await this.firestore.add({ uuid: uuid, id: minecraft_id });
this.cache.remove_by_first(uuid);
this.cache.set_by_second(uuid, minecraft_id);