44
55from .settings import config
66from .utils import get_app_description , generate_image_url , who_am_i
7+ from .discourse import get_topic_url_for_app
78
89party_time_emoji = ["🎉" ,"🥳" ,"👏" ,"❤️" ,"🥰" ,"🎊" ]
910
@@ -18,6 +19,19 @@ def announce_release(app, release, is_generated):
1819 release_notes = release .release_notes
1920 if not release_notes :
2021 release_notes = "N/A"
22+
23+ request_fields = [{
24+ "name" : "Release Notes" ,
25+ "value" : release_notes
26+ }]
27+
28+ topic_url = get_topic_url_for_app (app )
29+ if topic_url :
30+ request_fields .append ({
31+ "name" : "Discuss it on the Rebble Dev Forum!" ,
32+ "value" : topic_url
33+ })
34+
2135
2236 request_data = {
2337 "embeds" : [{
@@ -29,12 +43,7 @@ def announce_release(app, release, is_generated):
2943 "width" : 80
3044 },
3145 "description" : f"{ app .developer .name } just updated their { app .type } *{ app .title } * to version { release .version } !" ,
32- "fields" : [
33- {
34- "name" : "Release Notes" ,
35- "value" : release_notes
36- }
37- ]
46+ "fields" : request_fields
3847 }]
3948 }
4049
@@ -76,6 +85,13 @@ def announce_new_app(app, is_generated):
7685 "name" : "Website" ,
7786 "value" : app .website
7887 })
88+
89+ topic_url = get_topic_url_for_app (app )
90+ if topic_url :
91+ request_fields .append ({
92+ "name" : "Discuss it on the Rebble Dev Forum!" ,
93+ "value" : topic_url
94+ })
7995
8096 txt_type = app .type if not is_generated else "Generated Watchface"
8197
0 commit comments