This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose from 'mongoose'; | |
const { Schema } = mongoose; | |
const Listing = new Schema({ | |
"listing_id": { type: Number, index: true, unique: true }, | |
"title": String, | |
"expireAt": { type: Date, expires: 10 } // <========== TTL index here | |
}); | |
export { Listing }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as mineflayer from "mineflayer"; | |
const username = process.env.BOT_USERNAME || 'SAMPLE[bot]'; | |
const host = "127.0.0.1"; | |
const port = process.env.MINECRAFT_SERVER_PORT || 25565; // /publish true adventure 25565 | |
console.log(`chicken bot ${host}:${port}`) | |
const bot = mineflayer.createBot({host, port, username}); | |
// Log errors and kick reasons: | |
bot.on('kicked', console.log) |
OlderNewer