Skip to content

Instantly share code, notes, and snippets.

@M4R14
Last active March 1, 2022 17:28
Show Gist options
  • Select an option

  • Save M4R14/e993153bc9f01aef562d1d3571c76254 to your computer and use it in GitHub Desktop.

Select an option

Save M4R14/e993153bc9f01aef562d1d3571c76254 to your computer and use it in GitHub Desktop.
Control Ubuntu Sound With Telegram
const TeleBot = require('telebot');
const bot = new TeleBot(TELEGRAM_BOT_TOKEN);
bot.on('text', (msg) => msg.reply.text(msg.text));
bot.start();
const { exec } = require("child_process");
exec("ls -la", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment