-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsend.php
More file actions
45 lines (42 loc) · 1.29 KB
/
send.php
File metadata and controls
45 lines (42 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
// Max Base
// https://github.com/BaseMax/telegram-weather-bot
include "TinyTelegramBot.php";
$_res=[
get("http://api.weatherstack.com/current?access_key=*******&query=berlin"),
get("http://api.weatherstack.com/current?access_key=*******&query=Amsterdam"),
];
$_res[0]=json_decode($_res[0][0], true);
$_res[1]=json_decode($_res[1][0], true);
$chs=[
'-***001294257647',
'-***001479103968',
];
foreach($chs as $i=>$ch) {
$res=$_res[$i];
$chatID=[
'***', // Admin, User ID
'***', // Support Team, User ID
$ch,
];
$res='🌤 The weather today
🔻 City: '.$res["location"]["name"].', '.$res["location"]["country"].'
🔸 Temperature: '.$res["current"]["temperature"].' C°
🔸 Weather forecast: '.$res["current"]["weather_descriptions"][0].'
🔸 Wind speed: '.$res["current"]["wind_speed"].'
🔸 Sensible temperature: '.$res["current"]["feelslike"].' C°
🔸 Wind direction: '.$res["current"]["wind_degree"].' '.$res["current"]["wind_dir"].'
🔸 Time: '.$res["current"]["observation_time"].'
* This message is automatically sent daily to the channel at the same time
🔴 ';
foreach($chatID as $chat) {
$ress=$res;
if($chat == '-***001479103968') {
$ress.='@aqaye_holland';
}
else if($chat == '-***001294257647') {
$ress.='@khanome_german';
}
sendMessage($chat, $ress);
}
}