Add conditions to add to db.
This commit is contained in:
parent
82fdb73ad7
commit
1637b5541f
10
webhook.php
10
webhook.php
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
$bot_name = "smeagol_lotr_bot";
|
||||
$bot_api = require('api_key.php');
|
||||
|
||||
// Send html back to the sender.
|
||||
|
@ -59,4 +58,13 @@ if (!isset($decoded->{"message"}->{"text"})){
|
|||
|
||||
$text = $decoded->{"message"}->{"text"};
|
||||
|
||||
if (substr_count($text, " was completely clueless. Village was successfully pillaged. You feel pleased about yourself.") == 1){
|
||||
add_to_db(1);
|
||||
}
|
||||
elseif (substr_count($text, "noticed you and nearly beat you to death.") == 1){
|
||||
add_to_db(0);
|
||||
}
|
||||
elseif (substr_count($text, "tried stopping you, but you were stronger.") == 1){
|
||||
add_to_db(0);
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue