-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
/엇 요거 server_palette 말고 playground_palette에 넣어주세요. |
아하 playground_palette로 옮기도록 하겠습니다 |
@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("저장된 뉴스 링크가 모두 삭제되었습니다.") |
There was a problem hiding this comment.
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("역할 명")
을 활용하여 특정 역할을 가진 사용자만 실행할 수 있도록 제한하는 것이 필요합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다. 지금은 CHANNEL_ID_ALLOWED
로 특정채널에서만 가능하도록 해놨는데, 해당부분을 지우고 권한 방식으로 변경하겠습니다
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다 ;)
GeekNews 관리자 (
cogs/playground_palette/news_manager.py
)/news_add <url>
/news_list
/news_rm