-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(warlord): Website management section
- Loading branch information
Nickelza
committed
Nov 22, 2023
1 parent
cbd15b6
commit 2a86467
Showing
8 changed files
with
158 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,26 @@ | ||
from src.model.User import User | ||
from src.model.Warlord import Warlord | ||
from src.model.tgrest.TgRest import TgRest | ||
from src.model.tgrest.TgRestObjectType import TgRestObjectType | ||
|
||
|
||
class TgRestWarlordAppointment(TgRest): | ||
""" | ||
TgRestWarlordAppointment class is used to create a Telegram REST API request. | ||
""" | ||
|
||
def __init__(self, bot_id: str, object_type: TgRestObjectType, user_id: int, warlord_id: int, days: int): | ||
""" | ||
Constructor | ||
:param user_id: The user id | ||
:param warlord_id: The warlord id | ||
:param days: The number of days the user will be a warlord. Technically not necessary since it can be calculated | ||
from the end date, but it's easier to just pass it in. | ||
""" | ||
|
||
super().__init__(bot_id, object_type) | ||
|
||
self.user: User = User.get_by_id(user_id) | ||
self.warlord: Warlord = Warlord.get_by_id(warlord_id) | ||
self.days: int = days |
This file contains 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,23 @@ | ||
from src.model.User import User | ||
from src.model.Warlord import Warlord | ||
from src.model.tgrest.TgRest import TgRest | ||
from src.model.tgrest.TgRestObjectType import TgRestObjectType | ||
|
||
|
||
class TgRestWarlordRevocation(TgRest): | ||
""" | ||
TgRestWarlordRevocation class is used to create a Telegram REST API request. | ||
""" | ||
|
||
def __init__(self, bot_id: str, object_type: TgRestObjectType, user_id: int, warlord_id: int): | ||
""" | ||
Constructor | ||
:param user_id: The user id | ||
:param warlord_id: The warlord id | ||
""" | ||
|
||
super().__init__(bot_id, object_type) | ||
|
||
self.user: User = User.get_by_id(user_id) | ||
self.warlord: Warlord = Warlord.get_by_id(warlord_id) |
This file contains 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