斋月
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
功能
显示斋月期间的封斋(Fajr)和开斋(Maghrib)祈祷时间,并包含下一事件的倒计时。由免费的 Aladhan Prayer Times API 提供支持。该片段在非斋月期间会自动隐藏(可通过 hide_outside_ramadan 配置)。
示例配置
- json
- yaml
- toml
{
"type": "ramadan",
"style": "diamond",
"foreground": "#ffffff",
"background": "#1a472a",
"leading_diamond": "",
"trailing_diamond": "",
"template": "U0001F319 Roza {{.RozaNumber}} · {{.NextEvent}} in {{.TimeRemaining}}",
"options": {
"city": "Lahore",
"country": "PK",
"method": 1,
"school": 1
}
}
type: ramadan
style: diamond
foreground: "#ffffff"
background: "#1a472a"
leading_diamond:
trailing_diamond:
template: U0001F319 Roza {{.RozaNumber}} · {{.NextEvent}} in {{.TimeRemaining}}
options:
city: Lahore
country: PK
method: 1
school: 1
type = "ramadan"
style = "diamond"
foreground = "#ffffff"
background = "#1a472a"
leading_diamond = ""
trailing_diamond = ""
template = "U0001F319 Roza {{.RozaNumber}} · {{.NextEvent}} in {{.TimeRemaining}}"
[options]
city = "Lahore"
country = "PK"
method = 1
school = 1
选项
| Name | Type | Default | Description |
|---|---|---|---|
latitude | float64 | 0 | Latitude for prayer time calculation (use with longitude) |
longitude | float64 | 0 | Longitude for prayer time calculation (use with latitude) |
city | string | "" | City name for location lookup — takes precedence over latitude/longitude |
country | string | "" | Country name or ISO 3166 alpha-2 code — required when using city |
method | int | 3 | Prayer calculation method (0–23, 99). See Aladhan methods for details |
school | int | 0 | Madhab school: 0 = Shafi (standard), 1 = Hanafi |
hide_outside_ramadan | bool | true | Hide the segment when not in Ramadan |
first_roza_date | string | "" | Override first day of Ramadan as YYYY-MM-DD for local moon sighting |
http_timeout | int | 20 | HTTP request timeout in milliseconds |
信息
必须配置 城市 + 国家 或 纬度 + 经度。如果两者都提供,则 city + country 优先。
祈祷时间计算方法
请使用距离您所在地最近的发布机构所采用的方法。完整的 ID→机构对应关系如下:
| ID | 机构 |
|---|---|
| 0 | 什叶派伊斯纳阿沙里派,莱瓦研究所,库姆 |
| 1 | 伊斯兰科学大学,卡拉奇 |
| 2 | 北美伊斯兰协会 (ISNA) |
| 3 | 穆斯林世界联盟 (默认) |
| 4 | 乌姆古拉大学,麦加 |
| 5 | 埃及测绘总局 |
| 7 | 德黑兰大学地球物理研究所 |
| 8 | 海湾地区 |
| 9 | 科威特 |
| 10 | 卡塔尔 |
| 11 | 新加坡伊斯兰宗教理事会 |
| 12 | 法国伊斯兰联盟组织 |
| 13 | 土耳其宗教事务局 (实验性) |
| 14 | 俄罗斯穆斯林精神管理局 |
| 15 | 全球新月观测委员会 |
| 16 | 迪拜 (实验性) |
| 17 | 马来西亚伊斯兰发展局 (JAKIM) |
| 18 | 突尼斯 |
| 19 | 阿尔及利亚 |
| 20 | 印度尼西亚宗教部 |
| 21 | 摩洛哥 |
| 22 | 里斯本伊斯兰社区,葡萄牙 |
| 23 | 宗教基金、伊斯兰事务和圣城部,约旦 |
| 99 | 自定义 (通过 API 使用 methodSettings) |
注意:ID 6 未分配。
模板 (信息)
默认模板
🌙 Roza {{.RozaNumber}} · {{.NextEvent}} in {{.TimeRemaining}}
属性
| Name | Type | Description |
|---|---|---|
.Fajr | string | Sehar (Fajr) time in HH:MM format |
.Iftar | string | Iftar (Maghrib) time in HH:MM format |
.Imsak | string | Imsak time in HH:MM format (~10 min before Fajr) |
.RozaNumber | int | Day number within Ramadan (1–30) |
.NextEvent | string | Name of the next event: Sehar or Iftar |
.TimeRemaining | string | Countdown to the next event, e.g. 3h 42m |
.Fasting | bool | true when currently between Fajr and Maghrib (fasting window) |