Skip to content

Commit 3cdf66a

Browse files
authored
Merge pull request cyclic-software#1 from nordinz7/develop
fix: removed express and minor changes
2 parents 58e21d9 + f34ca1f commit 3cdf66a

File tree

4 files changed

+17
-403
lines changed

4 files changed

+17
-403
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# telegram-bot-prayer-time
1+
# Telegram-bot-prayer-time
2+
3+
## Fetch daily prayer times from https://www.e-solat.gov.my/
4+
5+
### Telegram Info:
6+
- Name: WaktuSolatMalaysia
7+
- username: @WaktuSolatMalaysiaBot
8+
9+
## Available commands
10+
## send "/hariini" without quotes, you will get today prayer time.

index.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require('dotenv').config()
2-
const app = require('express')()
32
const { Telegraf } = require('telegraf')
43
const { getPrayerTimes } = require('./utils')
54

@@ -13,7 +12,7 @@ bot.help((ctx) => ctx.reply('Send me a sticker'));
1312
bot.hears('hi', (ctx) => ctx.reply('Hey there'));
1413

1514
bot.command('hariini', async (ctx) => {
16-
const waktu = await getPrayerTimes("today", "JHR03")
15+
const waktu = await getPrayerTimes("today", "SGR03")
1716
let str = ''
1817
waktu.prayerTime.map((time) => {
1918
Object.entries(time).forEach(([key, value]) => {
@@ -23,17 +22,9 @@ bot.command('hariini', async (ctx) => {
2322
ctx.reply(str)
2423
});
2524

25+
console.log('--------running')
26+
2627
bot.launch();
2728

2829
process.once('SIGINT', () => bot.stop('SIGINT'));
29-
process.once('SIGTERM', () => bot.stop('SIGTERM'));
30-
31-
app.get('/prayerTime', async (req, res) => {
32-
const { period, zone } = req.query
33-
const prayerTime = await getPrayerTimes(period, zone)
34-
res.json(prayerTime)
35-
})
36-
37-
app.listen(process.env.PORT || 3000, () => {
38-
console.log('--------server is ruuning on port', 3000)
39-
})
30+
process.once('SIGTERM', () => bot.stop('SIGTERM'));

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
"dependencies": {
33
"axios": "^1.3.6",
44
"dotenv": "^16.0.3",
5-
"express": "^4.18.2",
65
"nodemon": "^2.0.22",
76
"telegraf": "^4.12.2"
87
},
98
"scripts": {
109
"dev": "nodemon index"
1110
}
12-
}
11+
}

0 commit comments

Comments
 (0)