Skip to content

feat: GeekNews 명령어 기능 추가 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 3, 2025
Merged

Conversation

cpprhtn
Copy link
Member

@cpprhtn cpprhtn commented Apr 1, 2025

GeekNews 관리자 (cogs/playground_palette/news_manager.py)

명령어 설명
/news_add <url> 뉴스 링크를 저장합니다.
/news_list 저장된 모든 뉴스 링크를 조회합니다. (geeknews-radio 스테이지에서만 동작)
/news_rm 저장된 모든 뉴스 링크를 삭제합니다. (geeknews-radio 스테이지에서만 동작)

@cpprhtn cpprhtn requested a review from choo121600 as a code owner April 1, 2025 08:18
@choo121600
Copy link
Member

choo121600 commented Apr 1, 2025

/엇 요거 server_palette 말고 playground_palette에 넣어주세요.
서버는 서버 관련된것만 넣는 곳이라.
#27

@cpprhtn
Copy link
Member Author

cpprhtn commented Apr 1, 2025

아하 playground_palette로 옮기도록 하겠습니다

Comment on lines 52 to 60
@slash_command(guild_ids=GUILD_ID, description="저장된 뉴스 링크를 모두 삭제합니다.")
async def news_rm(self, ctx):
if ctx.channel.id != CHANNEL_ID_ALLOWED:
await ctx.respond("이 명령어는 지정된 채널에서만 사용 가능합니다.", ephemeral=True)
return

cursor.execute("DELETE FROM news")
conn.commit()
await ctx.respond("저장된 뉴스 링크가 모두 삭제되었습니다.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 데이터의 삭제를 맡는 news_rm@slash_command에 별도의 권한 제한이 설정되어 있지 않습니다.
@commands.has_any_role("역할 명")을 활용하여 특정 역할을 가진 사용자만 실행할 수 있도록 제한하는 것이 필요합니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다. 지금은 CHANNEL_ID_ALLOWED 로 특정채널에서만 가능하도록 해놨는데, 해당부분을 지우고 권한 방식으로 변경하겠습니다

@cpprhtn
Copy link
Member Author

cpprhtn commented Apr 3, 2025

긱뉴스운영진 역할 두개에서만 삭제 가능하도록 변경하였습니다

Copy link
Member

@choo121600 choo121600 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다 ;)

@choo121600 choo121600 merged commit 9a58392 into SUSC-KR:main Apr 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants