Skip to content

Commit

Permalink
pause sa olet
Browse files Browse the repository at this point in the history
  • Loading branch information
shnigi committed Nov 1, 2023
1 parent 06af355 commit 0eade0b
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,29 +159,29 @@ bot.command('news', (ctx) => {
// }
// });

bot.on('text', async (ctx) => {
const { text, from } = ctx.message;
const targetUserId = 152047241;
if (from.id === targetUserId && text.toLowerCase().includes('sä olet')) {
const splitText = text.split(/sä olet/i);

if (splitText.length > 1) {
const wordsAfterSäOlet = splitText[1].trim();

if (wordsAfterSäOlet) {
const transformedText = wordsAfterSäOlet
.split('')
.map((char, index) => (index % 2 === 0 ? char.toLowerCase() : char.toUpperCase()))
.join('');

await ctx.replyWithPhoto(
{ source: './media/spongebob.jpg' },
{ caption: `sÄ oLeT ${transformedText}` },
);
}
}
}
});
// bot.on('text', async (ctx) => {
// const { text, from } = ctx.message;
// const targetUserId = 152047241;
// if (from.id === targetUserId && text.toLowerCase().includes('sä olet')) {
// const splitText = text.split(/sä olet/i);

// if (splitText.length > 1) {
// const wordsAfterSäOlet = splitText[1].trim();

// if (wordsAfterSäOlet) {
// const transformedText = wordsAfterSäOlet
// .split('')
// .map((char, index) => (index % 2 === 0 ? char.toLowerCase() : char.toUpperCase()))
// .join('');

// await ctx.replyWithPhoto(
// { source: './media/spongebob.jpg' },
// { caption: `sÄ oLeT ${transformedText}` },
// );
// }
// }
// }
// });

bot.command('roll', (ctx) => {
const number = Math.floor(Math.random() * 101);
Expand Down

0 comments on commit 0eade0b

Please sign in to comment.