Skip to content

Instantly share code, notes, and snippets.

Avatar

Luiz Marcus luizmarcus

View GitHub Profile
View chatbot_flutter_backend.php
<?php
require('parser.php');
function processMessage($text) {
if (isset($text)) {
if ($text === "mega") {
echo getResult('megasena', $text);
} else if ($text === "quina") {
echo getResult('quina', $text);
} else if ($text === "lotomania") {
View chatbot_flutter_onsend.dart
void onSend(ChatMessage message) async {
print(message.toJson());
setState(() {
messages = [...messages, message];
print(messages.length);
});
sendMessage(message.text);
}
void initDio() {
View chatbot_flutter_chatuser.dart
final ChatUser user = ChatUser(
name: "Usuário",
firstName: "Usuário",
lastName: "Fulano",
uid: "0001",
);
final ChatUser bot = ChatUser(
name: "Bot",
uid: "0002",
View chatbot_flutter_dashchat.dart
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Chat App"),
),
body: DashChat(
inverted: false,
onSend: onSend,
sendOnEnter: true,
View exemplo_inlinekeyboard_callbackData_file.php
<?php
define('BOT_TOKEN', '000000000:0000000000000000000000000000');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
function processMessage($message) {
// processa a mensagem recebida
$message_id = $message['message_id'];
$chat_id = $message['chat']['id'];
if (isset($message['text'])) {
View exemplo_inlinekeyboard_callbackData.php
<?php
'reply_markup' => array('inline_keyboard' => array(
//linha 1
array(
array('text'=>'Mega-Sena','url'=>'http://g1.globo.com/loterias/megasena.html'), //botão 1
array('text'=>'Quina','url'=>'http://g1.globo.com/loterias/quina.html')//botão 2
),
//linha 2
array(
View exemplo_admob_flutter_main_widget.dart
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
You can’t perform that action at this time.