-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edited commands, added a command to set building amounts.
- Loading branch information
Showing
9 changed files
with
91 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Module that contains admin commands. | ||
An admin command is a command that is only accessible to admins and should never be granted to a normal player | ||
(as they contain direct SQL evals, unlimited data manipulation, etc.) | ||
""" | ||
from typing import List, Optional | ||
|
||
import discord | ||
|
||
from sooch.commands.shared import services | ||
from sooch.services.players_load import Players | ||
from sooch.services.reg_buildings import RegBuildings | ||
|
||
|
||
async def set_building(client: discord.Client, | ||
message: discord.Message, | ||
content: List[str]) -> Optional[discord.Embed]: | ||
result = discord.Embed() | ||
|
||
await services.reg_buildings_svc.set_building_count(message.author.id, int(content[1]), int(content[2])) | ||
|
||
result.add_field(name="Set building", value="{} amount = {}".format(content[1], content[2])) | ||
return result |
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,10 @@ | ||
from typing import Optional | ||
|
||
|
||
class Services: | ||
def __init__(self): | ||
self.player_svc: Optional['Players'] = None | ||
self.reg_buildings_svc: Optional['RegBuildings'] = None | ||
|
||
|
||
services = Services() |
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
File renamed without changes.
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