问题描述
if(params[1] == "info")
{
cmdexist = true;
let totalSeconds = (bot.uptime / 1000);
let days = Math.floor(totalSeconds / 86400);
let hours = Math.floor(totalSeconds / 3600);
totalSeconds %= 3600;
let minutes = Math.floor(totalSeconds / 60);
let uptime = `${days} days,${hours} hours,${minutes} minutes`;
var countservers = 0; bot.guilds.cache.forEach(g => { countservers++ });
message.channel.send(`Please wait... getting informations!`).then((message) => {
var ssh = new SSH({
host: ssh_host,user: ssh_user,pass: ssh_pass,agent: process.env.SSH_AUTH_SOCK
});
ssh.exec('echo $PATH',{}).start();
ssh.exec('hostname',{ out: function(serverhostname) {
ssh.exec('uptime -p',{ out: function(serveruptime) {
ssh.exec('uptime -s',{ out: function(serveruptimesince) {
ssh.exec('cat /etc/redhat-release',{ out: function(serverversion) {
ssh.end();
serveruptime = serveruptime.slice(2);
const embed = new discord.MessageEmbed()
.setTitle("informations:")
.setThumbnail(bot.user.displayAvatarURL({dynamic : true,size : 2048}))
.setColor('#277ecd')
.addFields
(
{ name: "Developer:",value: `${developername}`,inline: false },{ name: "Version:",value: `${version}`,{ name: "Invite link:",value: "",{ name: "Last update:",value: `${lastupdate}`,{ name: "BOT uptime:",value: `${uptime}`,{ name: "Last restart:",value: `${restartdate}`,{ name: "Currently in:",value: `${countservers} servers`,{ name: "Server hostname:",value: `${serverhostname}`,{ name: "Server uptime:",value: `${serveruptime}`,{ name: "Server uptime since:",value: `${serveruptimesince}`,{ name: "OS platform:",value: `${serverversion}`,)
.setFooter(copyright);
message.delete();
message.channel.send(embed);
}}); }}); }}); }});
});
}
当我写命令时,它说我请稍等...获取信息!但永远不会过去。 我真的不明白为什么它不起作用。它托管在“游戏VPS”上,host(用户)通过MysqL VPS传递。对不起,我的英语不好。 :)预先感谢您的帮助。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)