-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.py
139 lines (109 loc) · 4 KB
/
core.py
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import ampalibe
from conf import Configuration
from requete import Requete
from Traitements import Traitement
import const
bot = ampalibe.init(Configuration())
req = Requete(Configuration())
opt = Traitement()
query = bot.query
chat = bot.chat
"""
get_started method, Utile pour permettre certainnes
fonctionnalités pour le bot afin que les utilisateurs
les benéficient
"""
# chat.get_started(payload="/get_started")
@ampalibe.command("/get_started")
def get_started(sender_id, **extends):
chat.send_message(sender_id, const.salutation)
chat.send_message(sender_id, const.description)
chat.send_media(sender_id, const.url_logo, "image")
chat.send_media(sender_id, const.url_video_presentation, "video")
chat.send_quick_reply(
sender_id, const.quick_rep_principal, const.quick_title_principal
)
chat.persistent_menu(sender_id, const.persistent_menu, action="PUT")
@ampalibe.command("/")
def main(sender_id, **extends):
chat.send_quick_reply(
sender_id, const.quick_rep_principal, const.quick_title_principal
)
# --------------COMMANDES QUICK_PRINCIPAL ET MENU PRINCIPAL-----------------#
@ampalibe.command("/nos_domaines")
def domaines(sender_id, **extends):
chat.send_message(sender_id, const.domaine_title_template)
chat.send_template(
sender_id,
opt.trt_template_domaine(),
quick_rep=const.quick_retour_principal,
)
@ampalibe.command("/nos_projets")
def projets(sender_id, **extends):
chat.send_message(sender_id, const.projets_title_template)
chat.send_template(
sender_id,
opt.trt_liste_projets(req.get_projet()),
quick_rep=const.quick_retour_principal,
next=True,
)
@ampalibe.command("/nos_competences")
def competence(sender_id, **extends):
chat.send_template(sender_id, opt.trt_competence())
@ampalibe.command("/nos_actualites")
def actualite(sender_id, **extends):
chat.send_message(sender_id, const.actualites_title_template)
chat.send_template(
sender_id,
opt.trt_liste_actualite(req.get_actualites()),
next=True,
)
@ampalibe.command("/nos_membres")
def membres(sender_id, **extends):
chat.send_message(sender_id, const.nos_projets_title_template)
chat.send_template(sender_id, opt.trt_liste_membre(req.get_membres()), next=True)
@ampalibe.command("/contact")
def contact(sender_id, **extends):
chat.send_message(
sender_id,
f"\t\tNOS CONTACTS:\n🏢Adresse : {const.adresse}\n☎Téléphone : {const.phone}\n✉Email : {const.email}",
)
chat.send_quick_reply(
sender_id, const.quick_retour_principal, const.quick_retour_principal_title
)
# ----------------------------------------------------------------------------#
# explication domaine
@ampalibe.command("/explication")
def explication(sender_id, explication, **extends):
chat.send_message(sender_id, explication)
chat.send_quick_reply(
sender_id, const.quick_retour_principal, const.quick_retour_principal_title
)
@ampalibe.command("/explicaion_competence")
def exlpicaion_competence(sender_id, explication, **extends):
chat.send_message(sender_id, explication)
chat.send_quick_reply(
sender_id, const.quick_retour_principal, const.quick_retour_principal_title
)
# voir details actualités
@ampalibe.command("/voir_details")
def details(sender_id, details, **extends):
chat.send_message(sender_id, details)
chat.send_quick_reply(
sender_id, const.quick_retour_principal, const.quick_retour_principal_title
)
# retoure au menu precédents
@ampalibe.command("/retour")
def retour(sender_id, **extends):
chat.send_quick_reply(
sender_id, const.quick_rep_principal, const.quick_title_principal
)
# interessé(e)
@ampalibe.command("/interesse")
def interesse(sender_id, id_membre, **extends):
data_membre = req.get_descriptions_membres(id_membre)
chat.send_button(
sender_id,
opt.trt_interesse(data_membre),
opt.trt_titre_button_interesse(data_membre),
)