[code]
<?php
/*
https://telegram.me/botfather 접속하여 봇아빠를 채팅창에 호출 하고 다음 커맨드를 입력
-------------------------------
봇이름 /newbot
봇실재아이디(끝에 bot을 붙여준다)
/token
/setabouttext
봇정보 안내문구
/setdescription
접속문구
-------------------------------
token이 바로 api
*/
header('Content-Type: text/html; charset=utf-8');
# 기본환경설정
define('TOKEN_KEY','');
define('BASE_URL', 'https://api.telegram.org/bot'.TOKEN_KEY);
# CURL Function
function GetCurl($url, $data=array()) {
// 서버로 전송 및 결과 반환
$rest = curl_init();
curl_setopt($rest, CURLOPT_URL, $url);
curl_setopt($rest, CURLOPT_POST, false);
curl_setopt($rest, CURLOPT_RETURNTRANSFER, true);
$Result = curl_exec($rest);
curl_close($rest);
return json_decode($Result, true);
}
if($_GET['type'] == 'room') {
# 채팅룸 추출
$Room = GetCurl(BASE_URL.'/getUpdates?limit=100');
$Room_id = array();
foreach($Room['result'] as $k=>$v) {
$Room_id[] = $v['message']['chat']['id'];
}
$Room_id = array_unique($Room_id);
$Room_id = array_values($Room_id);
var_dump($Room_id);
echo '<hr>';
var_dump($Room);
} else {
# 지정발송
if($_GET['room_id']) $Room_id = $_GET['room_id'];
else $Room_id = array('52227374','119732868', '84094887');
if($_GET['msg']) $msg = $_GET['msg'];
else $msg = date('Y-m-d H:i:s');
if(sizeof($Room_id) > 0) {
# 발송하기
foreach($Room_id as $k=>$v) {
$Result = GetCurl(BASE_URL.'/sendMessage?chat_id='.$v.'&text='.urlencode($msg));
print_r($Result);
echo '<hr>';
}
}
else if(is_array($Room_id) === false && $Room_id) {
$Result = GetCurl(BASE_URL.'/sendMessage?chat_id='.$Room_id.'&text='.urlencode($msg));
print_r($Result);
echo '<hr>';
}
}
[/code]

이런분안계시겠죠?
댓글 10개
이런사람입니다. ^^
미투 !!
잘될거에요!
봇생성만 조금 어렵지 그다음은 쉬우니....
좋은자료 감사합니다 .!!
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7630 | 10년 전 | 662 | ||
| 7629 |
|
10년 전 | 2405 | |
| 7628 | 10년 전 | 798 | ||
| 7627 |
|
10년 전 | 1041 | |
| 7626 |
|
10년 전 | 1797 | |
| 7625 | 10년 전 | 722 | ||
| 7624 | 10년 전 | 739 | ||
| 7623 |
|
10년 전 | 3109 | |
| 7622 | 10년 전 | 742 | ||
| 7621 |
leeleeleelee
|
10년 전 | 592 | |
| 7620 | 10년 전 | 544 | ||
| 7619 | 10년 전 | 500 | ||
| 7618 | 10년 전 | 1036 | ||
| 7617 | 10년 전 | 733 | ||
| 7616 | 10년 전 | 660 | ||
| 7615 | 10년 전 | 734 | ||
| 7614 | 10년 전 | 1273 | ||
| 7613 |
|
10년 전 | 2088 | |
| 7612 | 10년 전 | 1159 | ||
| 7611 | 10년 전 | 1430 | ||
| 7610 |
|
10년 전 | 1909 | |
| 7609 |
|
10년 전 | 1363 | |
| 7608 |
mwdkim
|
10년 전 | 1140 | |
| 7607 |
|
10년 전 | 1067 | |
| 7606 |
mwdkim
|
10년 전 | 3944 | |
| 7605 | 10년 전 | 697 | ||
| 7604 | 10년 전 | 1035 | ||
| 7603 | 10년 전 | 1658 | ||
| 7602 |
|
10년 전 | 1084 | |
| 7601 |
AniNest
|
10년 전 | 2803 | |
| 7600 |
port443
|
10년 전 | 1041 | |
| 7599 | 10년 전 | 953 | ||
| 7598 | 10년 전 | 1034 | ||
| 7597 | 10년 전 | 4582 | ||
| 7596 |
SeungYeon
|
10년 전 | 904 | |
| 7595 |
untitled
|
10년 전 | 2439 | |
| 7594 |
프로그래머7
|
10년 전 | 1744 | |
| 7593 |
untitled
|
10년 전 | 2387 | |
| 7592 |
untitled
|
10년 전 | 1953 | |
| 7591 |
untitled
|
10년 전 | 2684 | |
| 7590 |
아리마2001
|
10년 전 | 861 | |
| 7589 | 10년 전 | 1118 | ||
| 7588 |
|
10년 전 | 2930 | |
| 7587 | 10년 전 | 1314 | ||
| 7586 | 10년 전 | 678 | ||
| 7585 | 10년 전 | 1707 | ||
| 7584 | 10년 전 | 1419 | ||
| 7583 |
leeleeleelee
|
10년 전 | 1177 | |
| 7582 |
|
10년 전 | 1136 | |
| 7581 | 10년 전 | 1366 | ||
| 7580 | 10년 전 | 1016 | ||
| 7579 |
|
10년 전 | 612 | |
| 7578 | 10년 전 | 1435 | ||
| 7577 |
|
10년 전 | 1880 | |
| 7576 | 10년 전 | 1394 | ||
| 7575 |
멋진남자임
|
10년 전 | 1476 | |
| 7574 | 10년 전 | 2131 | ||
| 7573 | 10년 전 | 3263 | ||
| 7572 | 10년 전 | 768 | ||
| 7571 |
|
10년 전 | 786 | |
| 7570 |
|
10년 전 | 1328 | |
| 7569 | 10년 전 | 1560 | ||
| 7568 |
this1mg
|
10년 전 | 1058 | |
| 7567 |
|
10년 전 | 774 | |
| 7566 | 10년 전 | 922 | ||
| 7565 |
Angel하늘
|
10년 전 | 1019 | |
| 7564 |
seoldi
|
10년 전 | 1261 | |
| 7563 |
|
10년 전 | 1398 | |
| 7562 |
멋진남자임
|
10년 전 | 2099 | |
| 7561 | 10년 전 | 717 | ||
| 7560 |
leeleeleelee
|
10년 전 | 921 | |
| 7559 | 10년 전 | 5060 | ||
| 7558 |
RinaP
|
10년 전 | 795 | |
| 7557 |
|
10년 전 | 1260 | |
| 7556 | 10년 전 | 1201 | ||
| 7555 |
hyohyojj1234
|
10년 전 | 1673 | |
| 7554 | 10년 전 | 1104 | ||
| 7553 |
senseme
|
10년 전 | 1346 | |
| 7552 |
ehdltdoit
|
10년 전 | 1444 | |
| 7551 |
|
10년 전 | 1835 | |
| 7550 |
leeleeleelee
|
10년 전 | 1602 | |
| 7549 | 10년 전 | 2439 | ||
| 7548 | 10년 전 | 1853 | ||
| 7547 |
멋진남자임
|
10년 전 | 1971 | |
| 7546 | 10년 전 | 1013 | ||
| 7545 |
ILMare1003
|
10년 전 | 1301 | |
| 7544 |
|
10년 전 | 1261 | |
| 7543 | 10년 전 | 896 | ||
| 7542 | 10년 전 | 669 | ||
| 7541 |
울라라라우
|
10년 전 | 874 | |
| 7540 | 10년 전 | 1603 | ||
| 7539 | 10년 전 | 947 | ||
| 7538 |
|
10년 전 | 1839 | |
| 7537 | 10년 전 | 3622 | ||
| 7536 |
Gaumi
|
10년 전 | 1422 | |
| 7535 |
프로그램은어려워
|
10년 전 | 1284 | |
| 7534 |
senseme
|
10년 전 | 1212 | |
| 7533 | 10년 전 | 1210 | ||
| 7532 | 10년 전 | 874 | ||
| 7531 | 10년 전 | 2066 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기