telegram Command Enable #5
@@ -2,14 +2,28 @@ const { Telegraf } = require('telegraf')
|
|||||||
const token = require('../../index').token
|
const token = require('../../index').token
|
||||||
const bot = new Telegraf(token)
|
const bot = new Telegraf(token)
|
||||||
bot.start((ctx) => {
|
bot.start((ctx) => {
|
||||||
ctx.reply(`Hello ${ctx.message.from.username}\nWe have some things still being done in the programming of the new bot more works 👍:\n\nCommands:\n/server_start\n/server_stop\n/server_restart\n/log\n/command: Commands are not working in this version, wait until it is broken\n\nThe messages are re-transmitted to the minecraft chat if it is already connected: ✔\nMessage Control: ❌`)
|
const amenssagem = `Hello ${ctx.message.from.username}
|
||||||
|
We have some things still being done in the programming of the new bot more works 👍:
|
||||||
|
Commands:
|
||||||
|
/server_start
|
||||||
|
/server_stop
|
||||||
|
/server_restart
|
||||||
|
/log
|
||||||
|
/command: Commands are not working in this version, wait until it is broken
|
||||||
|
The messages are re-transmitted to the minecraft chat if it is already connected: ✔
|
||||||
|
Message Control: ❌`
|
||||||
|
ctx.reply(``)
|
||||||
})
|
})
|
||||||
bot.help((ctx) => ctx.reply('Use o/start'))
|
bot.help((ctx) => ctx.reply('Use o/start'))
|
||||||
bot.action('delete', ({ deleteMessage }) => deleteMessage())
|
bot.action('delete', ({ deleteMessage }) => deleteMessage())
|
||||||
bot.command('server_start', (ctx) => {
|
bot.command('server_start', (ctx) => {
|
||||||
if (require('./check').checkUser(ctx.message.from.username)){
|
if (require('./check').checkUser(ctx.message.from.username)){
|
||||||
console.log('Sucess')
|
const bds_status = require('../../index').detect()
|
||||||
ctx.reply(`Under maintenance ${ctx.message.from.username}`)
|
if (!bds_status){
|
||||||
|
require('../../index').start()
|
||||||
|
ctx.reply(`The server has started`)
|
||||||
|
} else
|
||||||
|
ctx.reply(`${ctx.message.from.username} already started`)
|
||||||
} else {
|
} else {
|
||||||
console.log('Erro');
|
console.log('Erro');
|
||||||
ctx.reply(`Please contact the Server Administrator, You are not on the list, I count to add your username \(${ctx.message.from.username}\) on the whitelist`)
|
ctx.reply(`Please contact the Server Administrator, You are not on the list, I count to add your username \(${ctx.message.from.username}\) on the whitelist`)
|
||||||
|
Reference in New Issue
Block a user