Skip to content

Commit

Permalink
feat: Add summonFairy
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoquiet committed Jun 26, 2022
1 parent 52ebb28 commit d8405a3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
### 요정

- `/지성이있나요`: 컬방에 요정이 있는지 알려줍니다.
- `/요정소환`: 지성이를 소환시킵니다.
- `/요정랭킹`: `/지성이있나요` 명령어를 얼마나 사용했는지 알려줍니다.

### 식사
Expand Down
11 changes: 9 additions & 2 deletions cogs/fairy.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,21 @@ async def fairy(self, ctx):
else:
await ctx.respond('없어요ㅠㅠ')

with open(f'fairy_archive/{dt.datetime.now().strftime("%Y.%m")}.txt', 'a') as archive:
with open(f'fairy_archive/{dt.datetime.now().strftime("%Y.%m")}.txt', 'a', encoding='euc-kr') as archive:
archive.write(dt.datetime.now().strftime(f'%Y-%m-%dT%H:%M:%S <{ctx.author.name}> <{ctx.guild}> {ctx.author.id} {1 if is_fairy else 0}\n'))

@slash_command(name='요정소환')
async def summonFairy(self, ctx):
"""지성이를 소환시킵니다."""

fairy = await self.bot.fetch_user(439817891240607746)
await ctx.respond(fairy.mention + ' 소환!')

@slash_command(name='요정랭킹')
async def fairyRank(self, ctx):
"""`/지성이있나요` 명령어를 얼마나 사용했는지 알려줍니다."""

with open(f'fairy_archive/{dt.datetime.now().strftime("%Y.%m")}.txt', 'r') as archive:
with open(f'fairy_archive/{dt.datetime.now().strftime("%Y.%m")}.txt', 'r', encoding='euc-kr') as archive:
fairyCounter = dict()

while True:
Expand Down
1 change: 1 addition & 0 deletions cogs/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ async def help(self, ctx):
helpEmbed.add_field(name='`/열렸나요`', value='컬방이 열려있는지 알려줍니다.', inline=True)
helpEmbed.add_field(name='`/열어주세요`', value='컬방 안의 사람들이 문을 열어주도록 합니다.', inline=True)
helpEmbed.add_field(name='`/지성이있나요`', value='컬방에 요정이 있는지 알려줍니다.', inline=True)
helpEmbed.add_field(name='`/요정소환`', value='지성이를 소환시킵니다.', inline=True)
helpEmbed.add_field(name='`/요정랭킹`', value='`/지성이있나요` 명령어를 얼마나 사용했는지 알려줍니다.', inline=True)
helpEmbed.add_field(name='`/점메추`', value='`점심 메뉴를 추천해줍니다.', inline=True)
helpEmbed.add_field(name='`/컬방`', value='컬방에 대한 정보를 알려줍니다.', inline=True)
Expand Down
4 changes: 3 additions & 1 deletion cogs/meal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from discord.ext.commands import Cog
from discord.commands import slash_command

from config import KertColor, KertVer

class Meal(Cog):
def __init__(self, bot):
self.bot = bot
Expand All @@ -11,7 +13,7 @@ def __init__(self, bot):
async def recommend_lunch(self, ctx):
"""점심 메뉴를 추천해줍니다."""

await ctx.respond(discord.Embed(title='점메추', description='요정이 열심히 개발 중...'))
await ctx.respond(discord.Embed(title='점메추', description='요정이 열심히 개발 중...', color=KertColor))



Expand Down

0 comments on commit d8405a3

Please sign in to comment.