Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Commit

Permalink
refactor: move TEST_GUILD_ID and DEV_GUILD_ID to .env
Browse files Browse the repository at this point in the history
  • Loading branch information
star0202 committed Jan 29, 2023
1 parent 59d30e3 commit 0a6d8b8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
TOKEN=""
DATABASE=""
TEST_GUILD_ID=[]
DEV_GUILD_ID=[]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
```py
TOKEN="your token"
DATABASE="your database file"
TEST_GUILD_ID=[test_guild_ids]
DEV_GUILD_ID=[dev_command_guild_ids]
```
- Make Virtual Environment & Activate it
- POSIX
Expand Down
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Final

VERSION: Final[str] = "v0.1.0" # 봇 버전
TEMPLATE_VERSION: Final[str] = "v1.3.1" # 템플릿 버전
TEMPLATE_VERSION: Final[str] = "v1.4.1" # 템플릿 버전
HELP_SELECT_RAW: Final[dict[str, str]] = { # 간단한 명령어 설명(매개변수 미포함)
"/도움말": "도움말을 출력합니다.",
"/봇": "봇의 정보를 출력합니다.",
Expand Down
5 changes: 4 additions & 1 deletion functions/dev.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
from json import loads
from logging import getLogger
from os import getenv
from traceback import format_exc

from aiosqlite import Error
from discord import ApplicationContext, Embed, Option
from discord.ext import commands

from classes import Bot
from config import BAD, COLOR, DEV_GUILD_ID
from config import BAD, COLOR
from utils import slash_command

logger = getLogger(__name__)
DEV_GUILD_ID = loads(getenv("DEV_GUILD_ID"))


class Dev(commands.Cog):
Expand Down
5 changes: 4 additions & 1 deletion utils/commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from json import loads
from os import getenv

from discord.commands import application_command, SlashCommand

from config import TEST_GUILD_ID
TEST_GUILD_ID = loads(getenv("TEST_GUILD_ID"))


def slash_command(**kwargs):
Expand Down

0 comments on commit 0a6d8b8

Please sign in to comment.