forked from Ninjasoturi/PokemonRaidBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrainer.php
66 lines (53 loc) · 1.68 KB
/
trainer.php
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
// Write to log.
debug_log('TRAINER()');
// For debug.
//debug_log($update);
//debug_log($data);
// Check access.
bot_access_check($update, 'trainer');
// Set message.
$msg = '<b>' . getTranslation('trainerinfo_set_yours') . '</b>';
// Init empty keys array.
$keys = [];
// Create keys array.
$keys = [
/* [
[
'text' => getTranslation('name'),
'callback_data' => '0:trainer_name:0'
]
],
*/
[
[
'text' => getTranslation('team'),
'callback_data' => '0:trainer_team:0'
],
[
'text' => getTranslation('level'),
'callback_data' => '0:trainer_level:0'
]
]
];
// Check access.
$access = bot_access_check($update, 'trainer-share', true, true);
// Display sharing options for admins and users with trainer-share permissions
if($access && (is_file(ROOT_PATH . '/access/' . $access) || $access == 'BOT_ADMINS')) {
// Add sharing keys.
$share_keys = [];
$share_keys[] = universal_inner_key($keys, '0', 'trainer_add', '0', getTranslation('trainer_message_share'));
$share_keys[] = universal_inner_key($keys, '0', 'trainer_delete', '0', getTranslation('trainer_message_delete'));
// Get the inline key array.
$keys[] = $share_keys;
// Add message.
$msg .= CR . CR . getTranslation('trainer_message_share_or_delete');
}
// Add abort key.
$nav_keys = [];
$nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort'));
// Get the inline key array.
$keys[] = $nav_keys;
// Send message.
send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]);
?>