Compare commits

...

40 Commits

Author SHA1 Message Date
a100324265 Reformatted and cleaned up everything 2025-04-16 18:05:07 +02:00
e90694f0aa Merge remote-tracking branch 'origin/master' 2025-04-16 17:58:35 +02:00
13f92b2817 Improved logging and fixed missing locale strings 2025-04-16 17:57:30 +02:00
939bb4fef3 Improved logging and fixed missing locale strings 2025-04-16 17:56:41 +02:00
906770ef60 Enabled automerge for Renovate 2025-04-16 15:56:35 +02:00
b85ca1d017 Added support for libbot 4.1.0 2025-04-16 15:54:52 +02:00
e906852abe Update dependency uvloop to v0.21.0 (#58)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [uvloop](https://github.com/MagicStack/uvloop) | minor | `==0.20.0` -> `==0.21.0` |

---

### Release Notes

<details>
<summary>MagicStack/uvloop (uvloop)</summary>

### [`v0.21.0`](https://github.com/MagicStack/uvloop/releases/tag/v0.21.0)

[Compare Source](https://github.com/MagicStack/uvloop/compare/v0.20.0...v0.21.0)

# Changes

-   Add cleanup_socket param on create_unix_server()
    ([#&#8203;623](https://github.com/MagicStack/uvloop/issues/623)) (by [@&#8203;fantix](https://github.com/fantix) in [`d6114d2`](https://github.com/MagicStack/uvloop/commit/d6114d2))

# Fixes

-   Use cythonized SO_REUSEPORT rather than the unwrapped native one. ([#&#8203;609](https://github.com/MagicStack/uvloop/issues/609))
    (by [@&#8203;ptribble](https://github.com/ptribble) in [`4083a94`](https://github.com/MagicStack/uvloop/commit/4083a94e) for [#&#8203;550](https://github.com/MagicStack/uvloop/issues/550))

-   UDP errors should result in protocol.error_received ([#&#8203;601](https://github.com/MagicStack/uvloop/issues/601))
    (by [@&#8203;jensbjorgensen](https://github.com/jensbjorgensen) in [`3c3bbef`](https://github.com/MagicStack/uvloop/commit/3c3bbeff))

-   Updates for Cython3 ([#&#8203;587](https://github.com/MagicStack/uvloop/issues/587))
    (by [@&#8203;alan-brooks](https://github.com/alan-brooks) in [`3fba9fa`](https://github.com/MagicStack/uvloop/commit/3fba9fab) for [#&#8203;587](https://github.com/MagicStack/uvloop/issues/587))

-   Test with Python 3.13 ([#&#8203;610](https://github.com/MagicStack/uvloop/issues/610))
    (by [@&#8203;edgarrmondragon](https://github.com/edgarrmondragon) in [`fb5a139`](https://github.com/MagicStack/uvloop/commit/fb5a139))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: https://git.end-play.xyz/profitroll/PyrogramBotBase/pulls/58
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-10-15 10:11:05 +03:00
a73534f688 Update dependency async_pymongo to v0.1.9 (#57)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [async_pymongo](https://github.com/Mayuri-Chan/async_pymongo) | patch | `==0.1.8` -> `==0.1.9` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #57
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-10-08 16:49:52 +03:00
d3bf927f33 Update dependency async_pymongo to v0.1.8 (#56)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [async_pymongo](https://github.com/Mayuri-Chan/async_pymongo) | patch | `==0.1.7` -> `==0.1.8` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #56
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-09-25 22:25:29 +03:00
2a4e3ad187 Update dependency async_pymongo to v0.1.7 (#55)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [async_pymongo](https://github.com/Mayuri-Chan/async_pymongo) | patch | `==0.1.6` -> `==0.1.7` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #55
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-09-21 01:52:39 +03:00
518bc0d278 Update dependency uvloop to v0.20.0 (#54)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [uvloop](https://github.com/MagicStack/uvloop) | minor | `==0.19.0` -> `==0.20.0` |

---

### Release Notes

<details>
<summary>MagicStack/uvloop (uvloop)</summary>

### [`v0.20.0`](https://github.com/MagicStack/uvloop/releases/tag/v0.20.0)

[Compare Source](https://github.com/MagicStack/uvloop/compare/v0.19.0...v0.20.0)

# Changes

-   Upgrade libuv to v1.48.0 ([#&#8203;600](https://github.com/MagicStack/uvloop/issues/600))
    (by [@&#8203;niklasr22](https://github.com/niklasr22) [@&#8203;fantix](https://github.com/fantix) in [`7777852`](https://github.com/MagicStack/uvloop/commit/77778525) for [#&#8203;596](https://github.com/MagicStack/uvloop/issues/596) [#&#8203;615](https://github.com/MagicStack/uvloop/issues/615))

# Fixes

-   Fix test_create_server\_4 with Python 3.12.5 ([#&#8203;614](https://github.com/MagicStack/uvloop/issues/614))
    (by [@&#8203;shadchin](https://github.com/shadchin) in [`62f9239`](https://github.com/MagicStack/uvloop/commit/62f92393))

-   Use len(os.sched_getaffinity(0)) instead of os.cpu_count() ([#&#8203;591](https://github.com/MagicStack/uvloop/issues/591))
    (by [@&#8203;avkarenow](https://github.com/avkarenow) in [`c8531c2`](https://github.com/MagicStack/uvloop/commit/c8531c24) for [#&#8203;591](https://github.com/MagicStack/uvloop/issues/591))

-   Inline \_Py_RestoreSignals() from CPython ([#&#8203;604](https://github.com/MagicStack/uvloop/issues/604))
    (by [@&#8203;befeleme](https://github.com/befeleme) in [`8511ba1`](https://github.com/MagicStack/uvloop/commit/8511ba1f) for [#&#8203;603](https://github.com/MagicStack/uvloop/issues/603))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: https://git.end-play.xyz/profitroll/PyrogramBotBase/pulls/54
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-08-15 23:48:19 +03:00
eeb6d04f51 Update dependency libbot to v3.2.3 (#53)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | patch | `==3.2.2` -> `==3.2.3` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #53
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-07-10 08:12:13 +03:00
264731c755 Update dependency async_pymongo to v0.1.6 (#52)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [async_pymongo](https://github.com/Mayuri-Chan/async_pymongo) | patch | `==0.1.5` -> `==0.1.6` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #52
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-06-23 14:34:06 +03:00
856b389b1b Update dependency async_pymongo to v0.1.5 (#51)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [async_pymongo](https://github.com/Mayuri-Chan/async_pymongo) | patch | `==0.1.4` -> `==0.1.5` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Co-authored-by: Profitroll <profitroll@noreply.localhost>
Reviewed-on: #51
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-06-02 12:54:53 +03:00
1671d30444 Update dependency libbot to v3.2.2 (#50)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | patch | `==3.2.1` -> `==3.2.2` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #50
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-05-26 23:58:23 +03:00
2e60b8616d Update dependency libbot to v3.2.1 (#49)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | minor | `==3.1.0` -> `==3.2.1` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #49
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-05-26 19:41:01 +03:00
ee8a92ad3a Main now exists after migration 2024-05-26 15:02:44 +02:00
d47239899a Added debug config option 2024-05-26 13:57:16 +02:00
29e379fa3b Update dependency libbot to v3.1.0 (#47)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | minor | `==3.0.0` -> `==3.1.0` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #47
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-05-24 22:46:35 +03:00
02bda76c68 Update dependency mongodb-migrations to v1.3.1 (#46) 2024-05-14 01:48:42 +03:00
3a4382fe5a Update dependency mongodb-migrations to v1.3.1 2024-05-14 01:27:32 +03:00
5109e9268d New session files added to ignore 2024-03-19 23:23:09 +02:00
a473c67905 Custom pykeyboard is now used 2024-01-03 23:53:50 +01:00
0931eea035 Bump libbot to 3.0.0 and apscheduler to ~=3.10.4 2024-01-03 23:23:53 +01:00
a7d6dcb1a0 Minor cleanups 2024-01-03 23:21:43 +01:00
24873996ac Update dependency libbot to v2.1.0 (#43)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [libbot](https://github.com/botlibx/libbot) | minor | `==2.0.1` -> `==2.1.0` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #43
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2023-12-28 13:36:04 +02:00
8ee7d5fe2e Update dependency uvloop to v0.19.0 (#26)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [uvloop](https://github.com/MagicStack/uvloop) | minor | `==0.18.0` -> `==0.19.0` |

---

### Release Notes

<details>
<summary>MagicStack/uvloop (uvloop)</summary>

### [`v0.19.0`](https://github.com/MagicStack/uvloop/releases/tag/v0.19.0)

[Compare Source](https://github.com/MagicStack/uvloop/compare/v0.18.0...v0.19.0)

# Changes

-   Drop support of Python 3.7 and update CI ([#&#8203;578](https://github.com/MagicStack/uvloop/issues/578))
    (by [@&#8203;fantix](https://github.com/fantix) in [`ee5ad26`](https://github.com/MagicStack/uvloop/commit/ee5ad26a) for [#&#8203;578](https://github.com/MagicStack/uvloop/issues/578))

# Fixes

-   Restore uvloop.new_event_loop and other missing uvloop members to typing ([#&#8203;573](https://github.com/MagicStack/uvloop/issues/573))
    (by [@&#8203;graingert](https://github.com/graingert) in [`5c500ee`](https://github.com/MagicStack/uvloop/commit/5c500ee2) for [#&#8203;573](https://github.com/MagicStack/uvloop/issues/573))

-   Fix docstring of loop.shutdown_default_executor ([#&#8203;535](https://github.com/MagicStack/uvloop/issues/535))
    (by [@&#8203;Gelbpunkt](https://github.com/Gelbpunkt) in [`919da56`](https://github.com/MagicStack/uvloop/commit/919da567) for [#&#8203;535](https://github.com/MagicStack/uvloop/issues/535))

-   Fix CI status badge ([#&#8203;522](https://github.com/MagicStack/uvloop/issues/522))
    (by [@&#8203;shuuji3](https://github.com/shuuji3) in [`0e9ff6c`](https://github.com/MagicStack/uvloop/commit/0e9ff6cd) for [#&#8203;522](https://github.com/MagicStack/uvloop/issues/522))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: https://git.end-play.xyz/profitroll/PyrogramBotBase/pulls/26
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2023-10-29 19:33:03 +02:00
d305d70f92 Update dependency uvloop to v0.18.0 (#20)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [uvloop](https://github.com/MagicStack/uvloop) | minor | `==0.17.0` -> `==0.18.0` |

---

### Release Notes

<details>
<summary>MagicStack/uvloop (uvloop)</summary>

### [`v0.18.0`](https://github.com/MagicStack/uvloop/releases/tag/v0.18.0)

[Compare Source](https://github.com/MagicStack/uvloop/compare/v0.17.0...v0.18.0)

# Fixes

-   CI fixes ([#&#8203;520](https://github.com/MagicStack/uvloop/issues/520), [#&#8203;553](https://github.com/MagicStack/uvloop/issues/553))
    (by [@&#8203;altendky](https://github.com/altendky) in [`7783f1c`](https://github.com/MagicStack/uvloop/commit/7783f1c5), [@&#8203;dulmandakh](https://github.com/dulmandakh) in [`1dd40f1`](https://github.com/MagicStack/uvloop/commit/1dd40f17))

-   Make extract_stack resilient to lacking frames. ([#&#8203;563](https://github.com/MagicStack/uvloop/issues/563))
    (by [@&#8203;jhance](https://github.com/jhance) in [`0687643`](https://github.com/MagicStack/uvloop/commit/06876434) for [#&#8203;563](https://github.com/MagicStack/uvloop/issues/563))

-   Port uvloop to Python 3.12 ([#&#8203;570](https://github.com/MagicStack/uvloop/issues/570))
    (by [@&#8203;1st1](https://github.com/1st1), [@&#8203;fantix](https://github.com/fantix) in [`9f82bd7`](https://github.com/MagicStack/uvloop/commit/9f82bd74) for [#&#8203;569](https://github.com/MagicStack/uvloop/issues/569))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: https://git.end-play.xyz/profitroll/PyrogramBotBase/pulls/20
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2023-10-15 17:48:20 +03:00
866ab2429f Added additional SQLite option 2023-08-23 15:45:15 +02:00
59bfc4c1ca Fixed a few nasty issues 2023-08-23 00:19:27 +02:00
4a2e15c6e7 Added collection validation 2023-08-18 20:43:22 +02:00
24a2837f34 Added migrations 2023-08-18 20:43:09 +02:00
32260e95a7 Improved docs and typing 2023-08-17 23:04:38 +02:00
4cbb51ca61 Changed find_user behavior 2023-08-17 15:21:08 +02:00
8dad53409b Added deprecation notice 2023-08-17 15:15:53 +02:00
b3805d66ef Minor improvements 2023-08-17 15:01:35 +02:00
ac36e70b7f Removed unused aiofiles 2023-08-14 15:17:56 +02:00
d8f8e49f31 Migrate to async_pymongo 2023-08-14 15:16:30 +02:00
faccb22bc0 Update dependency libbot to v2.0.1 (#16)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| libbot | patch | `==2.0.0` -> `==2.0.1` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #16
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2023-08-11 11:31:15 +03:00
fd349eb19c Update dependency aiofiles to ~=23.2.1 (#15)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [aiofiles](https://github.com/Tinche/aiofiles#history) ([changelog](https://github.com/Tinche/aiofiles#history)) | minor | `~=23.1.0` -> `~=23.2.1` |

---

### Release Notes

<details>
<summary>Tinche/aiofiles (aiofiles)</summary>

### [`v23.2.0`](https://github.com/Tinche/aiofiles/compare/v23.1.0...v23.2.0)

[Compare Source](https://github.com/Tinche/aiofiles/compare/v23.1.0...v23.2.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->

Reviewed-on: #15
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2023-08-09 23:20:37 +03:00
29 changed files with 485 additions and 141 deletions

2
.gitignore vendored
View File

@@ -155,6 +155,8 @@ cython_debug/
# Custom
config.json
*.session
*.session-wal
*.session-shm
*.session-journal
venv

View File

@@ -2,5 +2,16 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"packageRules": [
{
"matchUpdateTypes": [
"minor",
"patch",
"pin",
"digest"
],
"automerge": true
}
]
}

28
classes/callbacks.py Normal file
View File

@@ -0,0 +1,28 @@
from dataclasses import dataclass
from pyrogram.types import CallbackQuery
@dataclass
class CallbackLanguage:
language: str
@classmethod
def from_callback(cls, callback: CallbackQuery):
"""Parse callback query and extract language data from it.
### Args:
* callback (`CallbackQuery`): Callback query got from user interaction.
### Raises:
* `ValueError`: Raised when callback provided is not a language one.
### Returns:
* `CallbackLanguage`: Parsed callback query.
"""
action, language = str(callback.data).split(":")
if action.lower() != "language":
raise ValueError("Callback provided is not a language callback")
return cls(language)

View File

@@ -1,40 +1,27 @@
from typing import Union
from libbot.pyrogram.classes import PyroClient
from libbot.pyrogram.classes import PyroClient as LibPyroClient
from pyrogram.types import User
from classes.pyrouser import PyroUser
from modules.database import col_users
# PyroClient uses MongoDB implementation of PyroUser
# but you can also select SQLite one below
# from classes.pyrouser_sqlite import PyroUser
from classes.pyrouser_mongo import PyroUser
class PyroClient(PyroClient):
class PyroClient(LibPyroClient):
async def find_user(self, user: Union[int, User]) -> PyroUser:
"""Find User by it's ID or User object
"""Find User by its ID or User object.
### Args:
* user (`Union[int, User]`): ID or User object to extract ID from
* user (`Union[int, User]`): ID or User object to extract ID from.
### Returns:
* `PyroUser`: PyroUser object
* `PyroUser`: User in database representation.
"""
if (
col_users.find_one({"id": user.id if isinstance(user, User) else user})
is None
):
col_users.insert_one(
{
"id": user.id if isinstance(user, User) else user,
"locale": user.language_code if isinstance(user, User) else None,
}
)
db_record = col_users.find_one(
{"id": user.id if isinstance(user, User) else user}
return (
await PyroUser.find(user)
if isinstance(user, int)
else await PyroUser.find(user.id, locale=user.language_code)
)
if db_record is None:
raise TypeError(
f"User with ID {user.id if isinstance(user, User) else user} was not found in the database"
)
return PyroUser(**db_record)

View File

@@ -1,23 +0,0 @@
from typing import Union
from attrs import define
from bson import ObjectId
from modules.database import col_users
@define
class PyroUser:
"""Dataclass of DB entry of a user"""
_id: ObjectId
id: int
locale: Union[str, None]
async def update_locale(self, locale: str) -> None:
"""Change user's locale stored in the database
### Args:
* locale (`str`): New locale to be set
"""
col_users.update_one({"_id": self._id}, {"$set": {"locale": locale}})

55
classes/pyrouser_mongo.py Normal file
View File

@@ -0,0 +1,55 @@
from dataclasses import dataclass
from logging import Logger
from typing import Union
from bson import ObjectId
from modules.database_mongo import col_users
from modules.logging_utils import get_logger
logger: Logger = get_logger(__name__)
@dataclass
class PyroUser:
"""Dataclass of DB entry of a user"""
__slots__ = ("_id", "id", "locale")
_id: ObjectId
id: int
locale: Union[str, None]
@classmethod
async def find(cls, id: int, locale: Union[str, None] = None):
"""Find user in database and create new record if user does not exist.
### Args:
* id (`int`): User's Telegram ID
* locale (`Union[str, None]`, *optional*): User's locale. Defaults to `None`.
### Raises:
* `RuntimeError`: Raised when user entry after insertion could not be found.
### Returns:
* `PyroUser`: User with its database data.
"""
db_entry = await col_users.find_one({"id": id})
if db_entry is None:
inserted = await col_users.insert_one({"id": id, "locale": locale})
db_entry = await col_users.find_one({"_id": inserted.inserted_id})
if db_entry is None:
raise RuntimeError("Could not find inserted user entry.")
return cls(**db_entry)
async def update_locale(self, locale: Union[str, None]) -> None:
"""Change user's locale stored in the database.
### Args:
* locale (`Union[str, None]`): New locale to be set.
"""
logger.debug("%s's locale has been set to %s", self.id, locale)
await col_users.update_one({"_id": self._id}, {"$set": {"locale": locale}})

View File

@@ -0,0 +1,57 @@
import logging
from dataclasses import dataclass
from typing import Union
from modules.database_sqlite import cursor
from modules.logging_utils import get_logger
logger: logging.Logger = get_logger(__name__)
@dataclass
class PyroUser:
"""Dataclass of DB entry of a user"""
__slots__ = ("id", "locale")
id: int
locale: Union[str, None]
@classmethod
async def find(cls, id: int, locale: Union[str, None] = None):
"""Find user in database and create new record if user does not exist.
### Args:
* id (`int`): User's Telegram ID
* locale (`Union[str, None]`, *optional*): User's locale. Defaults to `None`.
### Raises:
* `RuntimeError`: Raised when user entry after insertion could not be found.
### Returns:
* `PyroUser`: User with its database data.
"""
db_entry = cursor.execute("SELECT id, locale FROM users WHERE id = ?", (id,)).fetchone()
if db_entry is None:
cursor.execute("INSERT INTO users VALUES (?, ?)", (id, locale))
cursor.connection.commit()
db_entry = cursor.execute("SELECT id, locale FROM users WHERE id = ?", (id,)).fetchone()
if db_entry is None:
raise RuntimeError("Could not find inserted user entry.")
return cls(*db_entry)
async def update_locale(self, locale: Union[str, None]) -> None:
"""Change user's locale stored in the database.
### Args:
* locale (`Union[str, None]`): New locale to be set.
"""
logger.debug("%s's locale has been set to %s", self.id, locale)
cursor.execute(
"UPDATE users SET locale = ? WHERE id = ?",
(locale, self.id),
)
cursor.connection.commit()

29
commands.json Normal file
View File

@@ -0,0 +1,29 @@
{
"start": {
"scopes": [
{
"name": "BotCommandScopeDefault"
},
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
},
"shutdown": {
"scopes": [
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
},
"remove_commands": {
"scopes": [
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
}
}

View File

@@ -1,4 +1,5 @@
{
"debug": false,
"locale": "en",
"bot": {
"owner": 0,
@@ -19,15 +20,5 @@
"reports": {
"chat_id": "owner"
},
"disabled_plugins": [],
"commands": {
"start": {
"scopes": [
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
}
}
"disabled_plugins": []
}

View File

@@ -1,5 +1,24 @@
{
"metadata": {
"flag": "🇬🇧",
"name": "English",
"codes": [
"en",
"en-US",
"en-GB"
]
},
"commands": {
"start": "Start using the bot"
"start": "Start using the bot",
"shutdown": "Turn off the bot",
"language": "Change bot's language",
"remove_commands": "Unregister all commands"
},
"messages": {
"start": "Welcome! I'm your bot!",
"locale_choice": "Alright. Please choose the language using keyboard below."
},
"callbacks": {
"locale_set": "Your language now is: {locale}"
}
}

View File

@@ -1,5 +1,23 @@
{
"metadata": {
"flag": "🇺🇦",
"name": "Українська",
"codes": [
"uk",
"uk-UA"
]
},
"commands": {
"start": "Почати користуватись ботом"
"start": "Почати користуватись ботом",
"shutdown": "Вимкнути бота",
"language": "Змінити мову бота",
"remove_commands": "Видалити всі команди"
},
"messages": {
"start": "Привіт! Я твій бот!",
"locale_choice": "Гаразд. Будь ласка, оберіть мову за допомогою клавіатури нижче."
},
"callbacks": {
"locale_set": "Встановлено мову: {locale}"
}
}

46
main.py
View File

@@ -1,9 +1,20 @@
import contextlib
import logging
from os import getpid
import logging.config
from argparse import ArgumentParser
from logging import Logger
from os import getpid, makedirs
from pathlib import Path
from sys import exit
from libbot.pyrogram.classes import PyroClient
from libbot.utils import json_read
from classes.pyroclient import PyroClient
from modules.logging_utils import get_logger, get_logging_config
# Main uses MongoDB implementation of DB,
# but you can also select SQLite one below
# from modules.migrator_sqlite import migrate_database
from modules.migrator_mongo import migrate_database
from modules.scheduler import scheduler
# Uncomment this and the line below client declaration
@@ -13,13 +24,21 @@ from modules.scheduler import scheduler
# from convopyro import Conversation
logging.basicConfig(
level=logging.INFO,
format="%(name)s.%(funcName)s | %(levelname)s | %(message)s",
datefmt="[%X]",
makedirs(Path("logs/"), exist_ok=True)
logging.config.dictConfig(get_logging_config())
logger: Logger = get_logger(__name__)
parser = ArgumentParser(
prog="__name__",
description="__description__",
)
logger = logging.getLogger(__name__)
# Remove if no database is being used
parser.add_argument("--migrate", action="store_true")
args = parser.parse_args()
with contextlib.suppress(ImportError):
import uvloop
@@ -28,13 +47,22 @@ with contextlib.suppress(ImportError):
def main():
client = PyroClient(scheduler=scheduler)
# Remove if no database is being used
if args.migrate:
migrate_database()
logger.info("Migration finished. Exiting...")
exit()
client = PyroClient(scheduler=scheduler, commands_source=json_read(Path("commands.json")))
# Conversation(client)
try:
client.run()
except KeyboardInterrupt:
logger.warning("Forcefully shutting down with PID %s...", getpid())
except Exception as exc:
logger.error("An unexpected exception has occurred: %s", exc, exc_info=exc)
exit(1)
finally:
if client.scheduler is not None:
client.scheduler.shutdown()

0
migrations/.gitkeep Normal file
View File

View File

@@ -1,32 +0,0 @@
"""Module that provides all database columns"""
from pymongo import MongoClient
from ujson import loads
with open("config.json", "r", encoding="utf-8") as f:
db_config = loads(f.read())["database"]
f.close()
if db_config["user"] is not None and db_config["password"] is not None:
con_string = "mongodb://{0}:{1}@{2}:{3}/{4}".format(
db_config["user"],
db_config["password"],
db_config["host"],
db_config["port"],
db_config["name"],
)
else:
con_string = "mongodb://{0}:{1}/{2}".format(
db_config["host"], db_config["port"], db_config["name"]
)
db_client = MongoClient(con_string)
db = db_client.get_database(name=db_config["name"])
collections = db.list_collection_names()
for collection in ["users"]:
if collection not in collections:
db.create_collection(collection)
col_users = db.get_collection("users")

24
modules/database_mongo.py Normal file
View File

@@ -0,0 +1,24 @@
"""Module that provides all database collections"""
from typing import Any, Mapping
from async_pymongo import AsyncClient, AsyncCollection, AsyncDatabase
from libbot.utils import config_get
db_config: Mapping[str, Any] = config_get("database")
if db_config["user"] is not None and db_config["password"] is not None:
con_string = "mongodb://{0}:{1}@{2}:{3}/{4}".format(
db_config["user"],
db_config["password"],
db_config["host"],
db_config["port"],
db_config["name"],
)
else:
con_string = "mongodb://{0}:{1}/{2}".format(db_config["host"], db_config["port"], db_config["name"])
db_client = AsyncClient(con_string)
db: AsyncDatabase = db_client.get_database(name=db_config["name"])
col_users: AsyncCollection = db.get_collection("users")

View File

@@ -0,0 +1,11 @@
"""Module that provides database access"""
import sqlite3
from pathlib import Path
from libbot.utils import config_get
db: sqlite3.Connection = sqlite3.connect(Path(config_get("database")))
cursor: sqlite3.Cursor = db.cursor()
cursor.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER, card TEXT, locale TEXT)")

35
modules/logging_utils.py Normal file
View File

@@ -0,0 +1,35 @@
import logging
from logging import Logger
from pathlib import Path
from typing import Any, Dict
from libbot.utils import config_get
def get_logging_config() -> Dict[str, Any]:
return {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": str(Path("logs/latest.log")),
"maxBytes": 500000,
"backupCount": 10,
"formatter": "simple",
},
"console": {"class": "logging.StreamHandler", "formatter": "systemd"},
},
"formatters": {
"simple": {"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"},
"systemd": {"format": "%(name)s - %(levelname)s - %(message)s"},
},
"root": {
"level": "DEBUG" if config_get("debug") else "INFO",
"handlers": ["file", "console"],
},
}
def get_logger(name: str) -> Logger:
return logging.getLogger(name)

22
modules/migrator_mongo.py Normal file
View File

@@ -0,0 +1,22 @@
from typing import Any, Mapping
from libbot.utils import config_get
from mongodb_migrations.cli import MigrationManager
from mongodb_migrations.config import Configuration
def migrate_database() -> None:
"""Apply migrations from folder `migrations/` to the database"""
db_config: Mapping[str, Any] = config_get("database")
manager_config = Configuration(
{
"mongo_host": db_config["host"],
"mongo_port": db_config["port"],
"mongo_database": db_config["name"],
"mongo_username": db_config["user"],
"mongo_password": db_config["password"],
}
)
manager = MigrationManager(manager_config)
manager.run()

View File

@@ -0,0 +1,24 @@
from os import rename
from pathlib import Path
from typing import Mapping
from libbot.utils import json_read
from modules.database_sqlite import cursor
def migrate_database() -> None:
"""Apply migrations from old JSON database to SQLite"""
if not Path("data/database.json").exists():
return
db_old: Mapping[str, Mapping[str, str]] = json_read(Path("data/database.json"))
for user, keys in db_old.items():
user_locale = None if "locale" not in keys else keys["locale"]
user_card = None if "card" not in keys else keys["card"]
cursor.execute("INSERT INTO users VALUES (?, ?)", (int(user), user_card, user_locale))
cursor.connection.commit()
rename(Path("data/database.json"), Path("data/database.migrated.json"))

View File

@@ -1,10 +1,9 @@
from pyrogram import filters
from pyrogram.client import Client
from pyrogram.types import CallbackQuery
from classes.pyroclient import PyroClient
@Client.on_callback_query(filters.regex("nothing")) # type: ignore
async def callback_nothing(app: PyroClient, clb: CallbackQuery):
await clb.answer(text="Nothing here...")
@PyroClient.on_callback_query(filters.regex("nothing")) # type: ignore
async def callback_nothing(app: PyroClient, callback: CallbackQuery):
await callback.answer(text=app._("nothing", "callbacks", locale=callback.from_user.language_code))

View File

@@ -1,12 +1,11 @@
from pyrogram import filters
from pyrogram.client import Client
from pyrogram.types import Message
from classes.pyroclient import PyroClient
@Client.on_message(
@PyroClient.on_message(
~filters.scheduled & filters.private & filters.command(["start"], prefixes=["/"]) # type: ignore
)
async def command_start(app: PyroClient, msg: Message):
await msg.reply_text("Welcome! I'm your bot!")
async def command_start(app: PyroClient, message: Message):
await message.reply_text(app._("start", "messages", locale=message.from_user.language_code))

View File

@@ -1,13 +1,12 @@
from pyrogram import filters
from pyrogram.client import Client
from pyrogram.types import Message
from classes.pyroclient import PyroClient
@Client.on_message(
@PyroClient.on_message(
~filters.scheduled & filters.private & filters.command(["remove_commands"], prefixes=["/"]) # type: ignore
)
async def command_remove_commands(app: PyroClient, msg: Message):
await msg.reply_text("Okay.")
async def command_remove_commands(app: PyroClient, message: Message):
await message.reply_text("Okay.")
await app.remove_commands(command_sets=await app.collect_commands())

View File

@@ -0,0 +1,16 @@
import asyncio
from pyrogram import filters
from pyrogram.types import Message
from classes.pyroclient import PyroClient
@PyroClient.on_message(
~filters.scheduled
& filters.private
& filters.command(["shutdown", "reboot", "restart"], prefixes=["/"]) # type: ignore
)
async def command_shutdown(app: PyroClient, msg: Message):
if msg.from_user.id == app.owner:
asyncio.get_event_loop().create_task(app.stop())

View File

@@ -1,10 +1,9 @@
from pyrogram import filters
from pyrogram.client import Client
from pyrogram.types import Message
from classes.pyroclient import PyroClient
@Client.on_message(filters.text & filters.private) # type: ignore
@PyroClient.on_message(filters.text & filters.private) # type: ignore
async def handler_echo(app: PyroClient, message: Message):
await message.reply(message.text[::-1])

View File

@@ -1,4 +1,3 @@
from pyrogram.client import Client
from pyrogram.types import (
InlineQuery,
InlineQueryResultArticle,
@@ -8,7 +7,7 @@ from pyrogram.types import (
from classes.pyroclient import PyroClient
@Client.on_inline_query() # type: ignore
@PyroClient.on_inline_query() # type: ignore
async def inline(app: PyroClient, inline_query: InlineQuery):
await inline_query.answer(
results=[

View File

@@ -1,23 +1,24 @@
from typing import List
from pykeyboard import InlineButton, InlineKeyboard
from pyrogram import filters
from pyrogram.client import Client
from pyrogram.types import CallbackQuery, Message
from classes.callbacks import CallbackLanguage
from classes.pyroclient import PyroClient
@Client.on_message(
@PyroClient.on_message(
~filters.scheduled & filters.private & filters.command(["language"], prefixes=["/"]) # type: ignore
)
async def command_language(app: PyroClient, message: Message):
user = await app.find_user(message.from_user)
keyboard = InlineKeyboard(row_width=2)
buttons = []
buttons: List[InlineButton] = []
for locale, data in app.in_every_locale("metadata").items():
buttons.append(
InlineButton(f"{data['flag']} {data['name']}", f"language:{locale}")
)
buttons.append(InlineButton(f"{data['flag']} {data['name']}", f"language:{locale}"))
keyboard.add(*buttons)
@@ -27,16 +28,16 @@ async def command_language(app: PyroClient, message: Message):
)
@Client.on_callback_query(filters.regex(r"language:[\s\S]*")) # type: ignore
@PyroClient.on_callback_query(filters.regex(r"language:[\s\S]*")) # type: ignore
async def callback_language(app: PyroClient, callback: CallbackQuery):
user = await app.find_user(callback.from_user)
language = str(callback.data).split(":")[1]
parsed = CallbackLanguage.from_callback(callback)
await user.update_locale(language)
await user.update_locale(parsed.language)
await callback.answer(
app._("locale_set", "callbacks", locale=language).format(
locale=app._("name", "metadata", locale=language)
app._("locale_set", "callbacks", locale=parsed.language).format(
locale=app._("name", "metadata", locale=parsed.language)
),
show_alert=True,
)

25
pyproject.toml Normal file
View File

@@ -0,0 +1,25 @@
[project]
name = "PyrogramBotBase"
authors = [{ name = "Profitroll" }]
readme = "README.md"
requires-python = ">=3.11"
[tool.black]
line-length = 108
target-version = ["py311", "py312", "py313"]
[tool.isort]
profile = "black"
[tool.mypy]
namespace_packages = true
install_types = true
strict = true
show_error_codes = true
[tool.pylint]
disable = ["line-too-long"]
[tool.pylint.main]
extension-pkg-whitelist = ["ujson"]
py-version = 3.11

View File

@@ -1,13 +1,10 @@
aiofiles~=23.1.0
apscheduler~=3.10.1
attrs~=23.1.0
black~=23.7.0
apscheduler~=3.11.0
async_pymongo==0.1.9
convopyro==0.5
pykeyboard==0.1.5
pymongo==4.4.1
pyrogram==2.0.106
tgcrypto==1.2.5
ujson==5.8.0
uvloop==0.17.0
libbot[speed,pyrogram]==4.1.0
tgcrypto-pyrofork==1.2.7
uvloop==0.21.0
# If uses MongoDB:
mongodb-migrations==1.3.1
--extra-index-url https://git.end-play.xyz/api/packages/profitroll/pypi/simple
libbot[speed,pyrogram]==2.0.0
pykeyboard==0.1.7

24
validation/users.json Normal file
View File

@@ -0,0 +1,24 @@
{
"$jsonSchema": {
"required": [
"id",
"locale"
],
"properties": {
"user": {
"bsonType": [
"int",
"long"
],
"description": "Telegram ID of user"
},
"locale": {
"bsonType": [
"string",
"null"
],
"description": "Preferred messages language according to user's preference"
}
}
}
}