-
Notifications
You must be signed in to change notification settings - Fork 0
Added Capo_Nucleo #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Luke505
wants to merge
3
commits into
iflare3g:master
Choose a base branch
from
Luke505:Add-Capo_Nucleo
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,7 +121,16 @@ def handle(msg): | |
| corso = response['Corso'] | ||
| cell = response['Num_tel'] | ||
| email = response['E_mail_1_Value'] | ||
| data = emoji.emojize(":boy: "+ nome + " " + cognome + "\n" + ":envelope: " + email + "\n" + ":telephone_receiver: " + cell + "\n" + ":books: " +corso + "\n" + ":hotel: " + stanza + "\n\n") | ||
| face = ":boy:" | ||
|
|
||
| if response['Capo_Nucleo'] == "Y": | ||
| face = u"\U0001F9D4" | ||
| stanza += " - Capo Nucleo" | ||
| elif response['Capo_Stanza'] == "Y": | ||
| face = ":man:" | ||
| stanza += " - Capo Stanza" | ||
|
|
||
| data = emoji.emojize(face + " " + nome + " " + cognome + "\n" + ":envelope: " + email + "\n" + ":telephone_receiver: " + cell + "\n" + ":books: " +corso + "\n" + ":hotel: " + stanza + "\n\n") | ||
| bot.sendChatAction(chat_id,'typing') | ||
| bot.sendMessage(chat_id,data) | ||
| else: | ||
|
|
@@ -148,8 +157,16 @@ def handle(msg): | |
| course = user['Corso'] | ||
| stanza = user['Stanza'] | ||
| sigla = user['Sigla'] | ||
| face = ":boy:" | ||
|
|
||
| if user['Capo_Nucleo'] == "Y": | ||
| face = u"\U0001F9D4" | ||
| stanza += " - Capo Nucleo" | ||
| elif user['Capo_Stanza'] == "Y": | ||
| face = ":man:" | ||
| stanza += " - Capo Stanza" | ||
|
|
||
| data += emoji.emojize(":boy: "+ nome + " " + cognome + "\n" + ":envelope: " + email + "\n" + ":telephone_receiver: " + cell + "\n" + ":books: " + course + "\n" + ":hotel: " + stanza + "\n" + ":ticket: " +sigla + "\n\n") | ||
| data += emoji.emojize(face + " " + nome + " " + cognome + "\n" + ":envelope: " + email + "\n" + ":telephone_receiver: " + cell + "\n" + ":books: " + course + "\n" + ":hotel: " + stanza + "\n" + ":ticket: " +sigla + "\n\n") | ||
|
|
||
| if data == "": | ||
| bot.sendMessage(chat_id,"Residente non trovato!") | ||
|
|
@@ -169,15 +186,15 @@ def handle(msg): | |
| for user in response: | ||
| nome = user['Nome'] | ||
| cognome = user['Cognome'] | ||
| cs = user["Capo_Stanza"] | ||
| capoNucleo = user["Capo_Nucleo"] | ||
| capoStanza = user["Capo_Stanza"] | ||
|
|
||
| if cognome == "Paciolla" and cs == "Y": | ||
| data+=emoji.emojize(u"\U0001f466\U0001f3ff" + nome + " " + cognome + " *- Capo Stanza*"+"\n") | ||
| if capoNucleo == "Y": | ||
| data+=emoji.emojize(u"\U0001F9D4 *" + nome + " " + cognome + " - Capo Nucleo*\n") | ||
| elif capoStanza == "Y": | ||
| data+=emoji.emojize(":man: *" + nome + " " + cognome + " - Capo Stanza*\n") | ||
| else: | ||
| if cs == "Y": | ||
| data+=emoji.emojize(":man: " + "*" + nome + "*" + " " + "*"+ cognome + " - Capo Stanza*" +"\n") | ||
| else: | ||
| data+=emoji.emojize(":boy: " + nome + " " + cognome +"\n") | ||
| data+=emoji.emojize(":boy: " + nome + " " + cognome +"\n") | ||
| if data == "": | ||
| bot.sendMessage(chat_id,"Stanza non trovata!") | ||
| else: | ||
|
|
@@ -197,11 +214,7 @@ def handle(msg): | |
| for user in response: | ||
| nome = user['Nome'] | ||
| cognome = user['Cognome'] | ||
|
|
||
| if nome == "Carlo" or cognome == "Longo": | ||
| data+=emoji.emojize(u"\U0001f466\U0001f3ff" + nome + " " + cognome + "\n") | ||
| else: | ||
| data+=emoji.emojize(":boy: " + nome + " " + cognome + "\n") | ||
| data+=emoji.emojize(":boy: " + nome + " " + cognome + "\n") | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. serve uno spazio tra += e gli oggetti in causa |
||
| if data == "": | ||
| bot.sendMessage(chat_id,"Incaricato non trovato!",reply_markup=ReplyKeyboardRemove()) | ||
| else: | ||
|
|
||
81 changes: 81 additions & 0 deletions
81
ElisBot/databases/ElisBot_Database_Schema_February_2020.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
| /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
| /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
| /*!40101 SET NAMES utf8 */; | ||
| /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
| /*!40103 SET TIME_ZONE='+01:00' */; | ||
| /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
| /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
| /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
| /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
|
|
||
| -- | ||
| -- Current Database: `ElisBot` | ||
| -- | ||
|
|
||
| CREATE DATABASE /*!32312 IF NOT EXISTS*/ `ElisBot` /*!40100 DEFAULT CHARACTER SET latin1 */; | ||
|
|
||
| USE `ElisBot`; | ||
|
|
||
| -- | ||
| -- Table structure for table `Incarichi` | ||
| -- | ||
|
|
||
| DROP TABLE IF EXISTS `Incarichi`; | ||
| /*!40101 SET @saved_cs_client = @@character_set_client */; | ||
| /*!40101 SET character_set_client = utf8 */; | ||
| CREATE TABLE `Incarichi` ( | ||
| `ID` int(11) NOT NULL AUTO_INCREMENT, | ||
| `Nome` varchar(30) DEFAULT NULL, | ||
| PRIMARY KEY (`ID`) | ||
| ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1; | ||
| /*!40101 SET character_set_client = @saved_cs_client */; | ||
|
|
||
| -- | ||
| -- Table structure for table `Residence_DB` | ||
| -- | ||
|
|
||
| DROP TABLE IF EXISTS `Residence_DB`; | ||
| /*!40101 SET @saved_cs_client = @@character_set_client */; | ||
| /*!40101 SET character_set_client = utf8 */; | ||
| CREATE TABLE `Residence_DB` ( | ||
| `Nome` varchar(30) DEFAULT NULL, | ||
| `Cognome` varchar(30) DEFAULT NULL, | ||
| `E_mail_1_Value` varchar(60) DEFAULT NULL, | ||
| `Seconda_mail` varchar(28) CHARACTER SET utf8 DEFAULT NULL, | ||
| `Tipo_tel` varchar(9) CHARACTER SET utf8 DEFAULT NULL, | ||
| `Corso` varchar(5) CHARACTER SET utf8 DEFAULT NULL, | ||
| `Sigla` varchar(3) CHARACTER SET utf8 DEFAULT NULL, | ||
| `Stanza` varchar(14) CHARACTER SET utf8 DEFAULT NULL, | ||
| `ID` int(11) NOT NULL AUTO_INCREMENT, | ||
| `Num_tel` varchar(30) DEFAULT NULL, | ||
| `Capo_Stanza` set('Y','N') NOT NULL DEFAULT 'N', | ||
| `Capo_Nucleo` set('Y','N') NOT NULL DEFAULT 'N', | ||
| PRIMARY KEY (`ID`) | ||
| ) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=latin1; | ||
| /*!40101 SET character_set_client = @saved_cs_client */; | ||
|
|
||
| -- | ||
| -- Table structure for table `Incaricato` | ||
| -- | ||
|
|
||
| DROP TABLE IF EXISTS `Incaricato`; | ||
| /*!40101 SET @saved_cs_client = @@character_set_client */; | ||
| /*!40101 SET character_set_client = utf8 */; | ||
| CREATE TABLE `Incaricato` ( | ||
| `ID_Residente` int(11) NOT NULL, | ||
| `ID_Incarico` int(11) NOT NULL, | ||
| PRIMARY KEY (`ID_Residente`,`ID_Incarico`), | ||
| KEY `ID_Incarico` (`ID_Incarico`), | ||
| CONSTRAINT `Incaricato_ibfk_1` FOREIGN KEY (`ID_Residente`) REFERENCES `Residence_DB` (`ID`) ON DELETE CASCADE, | ||
| CONSTRAINT `Incaricato_ibfk_2` FOREIGN KEY (`ID_Incarico`) REFERENCES `Incarichi` (`ID`) ON DELETE CASCADE | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
| /*!40101 SET character_set_client = @saved_cs_client */; | ||
|
|
||
| /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
| /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
| /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
| /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
| /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
| /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
| /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,7 +74,7 @@ def getUsersFromRoom(self,room): | |
|
|
||
| with self.connection.cursor() as cursor: | ||
|
|
||
| queryForUserInfo = 'select Nome,Cognome,Capo_Stanza from Residence_DB where Stanza like %s' | ||
| queryForUserInfo = 'select Nome,Cognome,Capo_Stanza,Capo_Nucleo from Residence_DB where Stanza like %s' | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem qui, probabilmente era un mio errore iniziale, snake_case anche qui |
||
| cursor.execute(queryForUserInfo,(room + "%")) | ||
| result = cursor.fetchall() | ||
| #print(result) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questa sintassi non va bene per Python, bisogna usare lo snake_case, quindi capo_nucleo in caso di parole "composte"