本文整理汇总了PHP中emoji函数的典型用法代码示例。如果您正苦于以下问题:PHP emoji函数的具体用法?PHP emoji怎么用?PHP emoji使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了emoji函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
if ($this->Message->text == 'dubs') {
$no = mt_rand(0, 9);
Telegram::talk($this->Message->Chat->id, "`" . str_repeat($no, 9) . "`");
return true;
}
$q = explode("d", trim($this->Message->text));
if (count($q) == 2 && is_numeric($q[0]) && is_numeric($q[1])) {
$no = intval($q[0]);
$sides = intval($q[1]);
if ($no < 0 || $sides < 0 || $no > 50 || $sides > 999999999) {
Telegram::talk($this->Message->Chat->id, "naw brah");
return false;
}
$out = array_map("mt_rand", array_fill(0, $no, 1), array_fill(0, $no, $sides));
$out = implode(", ", $out);
Telegram::talk($this->Message->Chat->id, "`" . $out . "`");
} else {
$out = mt_rand(0, 999999999);
$dubs = array(9 => "nines", 8 => "eights", 7 => "sevens", 6 => "sixes", 5 => "quints", 4 => "quads", 3 => "trips", 2 => "dubs");
foreach ($dubs as $key => $value) {
$test = substr(strval($out), 0 - $key);
if (preg_match('/^(.)\\1*$/', $test)) {
$text = str_repeat(emoji(0x1f389), $key - 1) . "`" . sprintf('%09d', $out) . "`" . "\nnice " . $value . " brah" . str_repeat("!", $key - 1);
Telegram::talk($this->Message->Chat->id, $text);
return true;
}
}
Telegram::talk($this->Message->Chat->id, "`" . sprintf('%09d', $out) . "`");
}
return true;
}
示例2: main
public function main()
{
$Vote = new Vote($this->db);
$user_vote_total = $Vote->getVoteTotalForUserInChat($this->Message->User, $this->Message->Chat->id);
$user_vote_from = $Vote->getUserVotesInChat($this->Message->User, $this->Message->Chat->id);
$out = "You're on *{$user_vote_total}*. ";
if (count($user_vote_from) > 0) {
$out .= "You've voted as follows:";
$thumbs_up = emoji(0x1f44d);
$thumbs_down = emoji(0x1f44e) . emoji(0x1f3ff);
foreach ($user_vote_from as $userVote) {
$emoji = $userVote->vote == VoteType::Up ? $thumbs_up : $thumbs_down;
$out .= "\n` `• " . $emoji . " *" . ($userVote->voted_for ? $userVote->voted_for->getName() : 'uhoh') . "* ";
}
} else {
$out .= "You haven't cast any votes.";
}
$out .= "\nYou can see the voting leaderboard with /vote";
Telegram::talk($this->Message->Chat->id, $out);
}
示例3: main
public function main()
{
if ($this->isParam() && $this->noParams() > 2) {
$params = explode(' to ', $this->getAllParams(), 2);
if (count($params) == 2) {
try {
$date_due = Carbon::parse($params[0]);
$reminder = new Reminder();
$reminder->construct($this->Message->User->user_id, $this->Message->Chat->id, Carbon::now()->toDateTimeString(), $date_due->toDateTimeString(), $params[1]);
$ReminderControl = new Control($this->db);
$ReminderControl->addReminder($reminder);
$diff = $date_due->diffForHumans(Carbon::now(), true);
$out = emoji(0x23f2) . " Okay, I've scheduled a reminder in *{$diff}*.";
if ($date_due->diffInMinutes(Carbon::now()) < 60) {
$out .= "\n\nBy the way, I only send out notifications once a minute.";
}
Telegram::talk($this->Message->Chat->id, $out);
return true;
} catch (\Exception $e) {
// nada
}
}
}
$out = emoji(0x270d) . " Like this fam: " . "\n" . "\n` `• `/remind` *+2 hours* `to` *pick up the milk*" . "\n` `• `/remind` *2:25PM 26th April* `to` *look out the window*" . "\n` `• `/remind` *tomorrow 5PM* `to` *go outside*" . "\n` `• `/remind` *monday 2AM* `to` *go to sleep*" . "\n" . "\nMy timezone is *GMT+8*, and it's now *" . date('g:i A') . "* on the *" . date('jS') . "*.";
Telegram::talk($this->Message->Chat->id, $out);
return true;
}
示例4: getTileEmoji
public function getTileEmoji($reveal = false)
{
if ($reveal) {
if ($this->mine) {
return emoji(0x1f4a5);
}
if ($this->number == 0) {
return emoji(0x2b1c);
}
return emoji(0x30 + $this->number) . emoji(0xfe0f) . emoji(0x20e3);
}
if ($this->revealed && $this->mine) {
return emoji(0x1f4a5);
}
if ($this->revealed && $this->number == 0) {
return emoji(0x2b1c);
}
if ($this->revealed) {
return emoji(0x30 + $this->number) . emoji(0xfe0f) . emoji(0x20e3);
}
if ($this->flagged) {
return emoji(0x1f6a9);
}
return emoji(0x2b1b);
}
示例5: main
public function main()
{
$Transact = new Transact($this->db);
if ($this->noParams() == 2) {
$user_receiving = Query::getUserMatchingStringOrErrorMessage($this->db, $this->Message->Chat, $this->getParam());
if (is_string($user_receiving)) {
Telegram::talk($this->Message->Chat->id, $user_receiving);
return false;
}
$Transaction = new Transaction($this->Message->User, $user_receiving, $this->getParam(1), new TransactionType(TransactionType::Manual));
$Transact->performTransaction($Transaction);
if ($Feedback = $Transact->Feedback->getFeedback()) {
$out = emoji("0x1F4E2") . " " . $Feedback . "\n` `• `" . $user_receiving->getName() . "` now has 💰*" . $user_receiving->getBalance() . "*" . "\n` `• `You've` got 💰*" . $this->Message->User->getBalance() . "* left.";
if ($user_receiving->user_id != -1) {
$out .= "\n` `• `The Bank` took 2%, or 💰*" . round($this->getParam(1) * 0.02, 2) . "*";
}
Telegram::talk($this->Message->Chat->id, $out);
} else {
Telegram::talk($this->Message->Chat->id, "I'm so sorry brah...");
}
} else {
Telegram::talk($this->Message->Chat->id, "Like this fam " . emoji("0x1F449") . " /send richardstallman 10");
}
return true;
}
示例6: getRecentLogsText
public function getRecentLogsText()
{
$logs = $this->SQL->RetrieveRecentLogs('5');
$out = "";
if (!empty($logs)) {
$logs = array_slice($logs, 0, 4);
foreach ($logs as $i) {
$date = date('D jS g:iA', strtotime($i['date']));
$out .= "\n`" . $date . "` \n` `" . emoji(0x27a1) . " *";
if ($i->type == TransactionType::Manual) {
$out .= $i->user_sending . "* ";
} elseif ($i->type == TransactionType::TransactionTax || $i->type == TransactionType::AllTax) {
$out .= COIN_TAXATION_BODY . "* collected ";
} elseif ($i->type == TransactionType::RedistributionTax) {
$out .= COIN_REDISTRIBUTION_BODY . "* redistributed ";
}
if ($i->type == TransactionType::Manual) {
$out .= " (" . round($i->amount, 2) . " " . $i->user_receiving->user_name . " tax)";
} elseif ($i->type == TransactionType::TransactionTax || $i->type == TransactionType::AllTax) {
$out .= round($i->amount, 2) . " in tax";
} elseif ($i->type == TransactionType::RedistributionTax) {
$out .= round($i->amount, 2) . " of *" . COIN_TAXATION_BODY . "'s* wealth";
} elseif (strcmp($i->user_receiving->user_name, COIN_TAXATION_BODY)) {
$out .= 'sent ' . round($i->amount, 2) . " to *" . $i->user_receiving->user_name . "*";
} else {
$out .= 'donated ' . round($i->amount, 2) . " to *" . $i->user_receiving->user_name . "*";
}
}
} else {
$out .= "No recent transactions found.";
}
return $out;
}
示例7: main
public function main()
{
$RussianRoulette = new RussianRoulette($this->db, $this->Message->Chat->id, $this->Message->User->user_id);
$RussianRoulette->reload();
$out = emoji(0x1f52b) . " `Revolver reloaded.`" . "\n" . "\nThere are *six* chambers, and *one* bullet." . "\nUse /trigger to play.";
Telegram::talk($this->Message->Chat->id, $out);
}
示例8: display
public function display()
{
if ($this->minesweeper->game->state == GameState::Lose) {
$this->state = 'lose';
}
if ($this->minesweeper->game->state == GameState::Win) {
$this->state = 'win';
}
if (strcmp($this->state, 'surrender') === 0) {
$this->out = "You surrendered. Game over!";
$this->keyboard = $this->minesweeper->getBoard(true);
$this->keyboard[] = [['text' => emoji(0x21a9) . " Play again", 'callback_data' => "/minesweeper"]];
} elseif (strcmp($this->state, 'lose') === 0) {
$this->out = "Boom! Game over.";
$this->keyboard = $this->minesweeper->getBoard(true);
$this->keyboard[] = [['text' => emoji(0x21a9) . " Play again", 'callback_data' => "/minesweeper"]];
} elseif (strcmp($this->state, 'win') === 0) {
$this->out = "Victory! You uncovered all the non-mined tiles.";
$this->keyboard = $this->minesweeper->getBoard(true);
$this->keyboard[] = [['text' => emoji(0x21a9) . " Play again", 'callback_data' => "/minesweeper"]];
} elseif (strcmp($this->state, 'reveal_mode') === 0) {
$this->out = "Click mode: *uncover mine*";
$this->keyboard = $this->minesweeper->getBoard();
$this->keyboard[] = [['text' => emoji(0x1f6a9) . " Toggle Flags ON", 'callback_data' => "/minesweeper flag_mode"], ['text' => emoji(0x1f6aa) . " Surrender", 'callback_data' => "/minesweeper surrender"]];
} else {
$this->out = "Click mode: *place flag*";
$this->keyboard = $this->minesweeper->getBoard();
$this->keyboard[] = [['text' => emoji(0x1f6a9) . " Toggle Flags OFF", 'callback_data' => "/minesweeper reveal_mode"], ['text' => emoji(0x1f6aa) . " Surrender", 'callback_data' => "/minesweeper surrender"]];
}
}
示例9: emoji
protected function emoji($text)
{
if (defined('STRICT_TYPES') && CAMEL_CASE == '1') {
return (string) self::parameters(['text' => DT::STRING])->call(__FUNCTION__)->with($text)->returning(DT::STRING);
} else {
return (string) emoji($text);
}
}
示例10: main
public function main()
{
$Level = new Level();
$user = $this->Message->User;
$greetings = array("Arise", "Congratulations");
if ($Level->buyLevel($user, $this->db)) {
$out = emoji(0x1f4ef) . " " . $greetings[mt_rand(0, count($greetings) - 1)] . " *" . $user->getName() . "*, you are now a *Level " . $user->level . " " . $user->getTitle() . "*!" . "\nYou may rise to Level " . ($user->level + 1) . " for a price of " . $Level->getLevelPrice($user->level + 1) . " Coin.";
} else {
$out = emoji(0x1f44e) . " Sorry, you need " . $Level->getLevelPrice($user->level + 1) . " Coin to rise to Level " . ($user->level + 1) . ".";
}
Telegram::talk($this->Message->Chat->id, $out);
}
示例11: main
public function main()
{
if ($this->Message->isCallback()) {
if ($this->isParam() && strcmp($this->getParam(), 'button') === 0) {
$this->out = emoji(0x1f38c) . " *WINNER!*\n\n*" . $this->Message->User->getName() . "* clicked the button!";
Telegram::edit_inline_message($this->Message->Chat->id, $this->Message->message_id, $this->out, $this->keyboard);
}
} else {
$this->out = emoji(0x1f3c1) . " *Click the button to win!!*";
$this->generateKeyboard();
Telegram::talk_inline_keyboard($this->Message->Chat->id, $this->out, $this->keyboard);
}
return true;
}
示例12: main
public function main()
{
if ($this->isParam()) {
$user = Query::getUserMatchingStringOrErrorMessage($this->db, $this->Message->Chat, $this->getParam());
if (is_string($user)) {
Telegram::talk($this->Message->Chat->id, $user);
return false;
}
Telegram::talk($this->Message->Chat->id, $user->getNameLevelAndTitle() . " has " . emoji("0x1F4B0") . "*" . $user->getBalance() . "*, brah");
} else {
Telegram::talk($this->Message->Chat->id, "You've got " . emoji("0x1F4B0") . "*" . $this->Message->User->getBalance() . "*, brah");
}
return true;
}
示例13: main
public function main()
{
$this->out = emoji(0x1f4a2) . " *A great rumbling fills the earth...* " . emoji(0x1f4a2) . "\n";
if ($this->Message->User->getBalance() > 0 && $this->Message->User->level > 1) {
$choices = ['loseFreeBets', 'losePopularity', 'loseAllMoney', 'dropOneLevel'];
} elseif ($this->Message->User->getBalance() > 0 && $this->Message->User->level == 1) {
$choices = ['loseFreeBets', 'losePopularity', 'loseAllMoney'];
} elseif ($this->Message->User->getBalance() == 0 && $this->Message->User->level > 1) {
$choices = ['loseFreeBets', 'losePopularity', 'dropOneLevel'];
} else {
$choices = ['loseFreeBets', 'losePopularity'];
}
$this->{$choices[mt_rand(0, count($choices) - 1)]}();
Telegram::talk($this->Message->Chat->id, $this->out);
}
示例14: t_roll
function t_roll($text, $chat_id)
{
$out = mt_rand(0, 999999999);
$dubs = array(9 => "nines", 8 => "eights", 7 => "sevens", 6 => "sixes", 5 => "quints", 4 => "quads", 3 => "trips", 2 => "dubs");
foreach ($dubs as $key => $value) {
$test = substr(strval($out), 0 - $key);
if (preg_match('/^(.)\\1*$/', $test)) {
$text = str_repeat(emoji(0x1f389), $key - 1) . sprintf('%09d', $out) . "\nnice " . $value . " brah" . str_repeat("!", $key - 1);
talk($chat_id, $text);
return true;
}
}
talk($chat_id, sprintf('%09d', $out));
return true;
}
示例15: sendReminders
public function sendReminders()
{
$reminders = $this->SQL->select_reminders();
$UserDb = new User($this->db);
/** @var Reminder $reminder */
foreach ($reminders as $reminder) {
$date_due = Carbon::parse($reminder->date_due);
$date_created = Carbon::parse($reminder->date_created);
if ($date_due->lte(Carbon::now())) {
$user = $UserDb->getUserFromId($reminder->user_id);
$out = emoji(0x23f0) . " *" . $user->getName() . "*, your reminder from *" . $date_created->diffForHumans(Carbon::now(), true) . "* ago:" . "\n" . "\n`" . $reminder->content . "`";
Telegram::talkForced($reminder->chat_id, $out);
$this->SQL->delete_reminder($reminder);
}
}
}