Commit 5dc0939a authored by nanahira's avatar nanahira

docker things

parent c6c7d654
Pipeline #1997 passed with stages
in 6 minutes and 35 seconds
......@@ -5,5 +5,6 @@ COPY ./package*.json ./
RUN npm ci
COPY . ./
RUN npm run build
ENV USERNAME Irrlicht
CMD ["npm", "run", "start"]
CMD ["./run.sh"]
......@@ -4,6 +4,7 @@
"description": "Offers money to a specific account",
"main": "build/run.js",
"scripts": {
"build": "tsc",
"test": "node build/run.js Irrlicht"
},
"repository": {
......
#!/bin/bash
node build/run.js "$USERNAME"
......@@ -11,14 +11,6 @@ function randomString(len: number) {
return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len);
};
async function waitBotLogin(bot: Bot) {
return new Promise(done => {
bot.once("spawn", () => {
done();
})
})
}
function getChatMessageTexts(rawMessage: ChatMessage): string[] {
const messageObjects = (rawMessage.json as any).extra as any[];
if (!messageObjects) {
......@@ -49,7 +41,7 @@ async function runOnce(targetUser: string) {
console.log(`Creating bot ${username} ${password}.`);
const bot = createBot({
username,
host: '43.248.187.76',
host: 'wolfxmc.org',
port: 25565
});
bot.on('message', (message) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment