29 lines
939 B
JavaScript
29 lines
939 B
JavaScript
const { Snake } = require('tgsnake');
|
|
// replace the value below with the Telegram token you receive from @BotFather
|
|
|
|
const API_HASH = process.env.TELEGRAM_API_HASH || '9999999999:asdfASDF-asdfasdf_asdf';
|
|
const API_ID = process.env.TELEGRAM_API_ID || 12312312;
|
|
|
|
const client = new Snake(
|
|
{
|
|
apiHash : API_HASH,
|
|
apiId : API_ID,
|
|
login : {
|
|
botToken : '',
|
|
sessionName : 'IHateAudio',
|
|
forceDotSession : true,
|
|
|
|
},
|
|
logLevel : ['error','info'],
|
|
clientOptions : {"ipv6":false},
|
|
plugins : []
|
|
}
|
|
);
|
|
//const client = new Snake();
|
|
|
|
client.on('msg.voice', (ctx) => {
|
|
if(ctx.message.chat.type === "private"){
|
|
ctx.msg.reply("Erabiltzaile honek ez du audio mezurik onartzen. Esta usuaria no acepta mensajes de audio. This user doesn't allow audio messages. 🤷🏻♀️");
|
|
}
|
|
});
|
|
client.run(); //snake running
|