Skip to content
/ bampal2 Public

๐Ÿ˜ ๋™๊ตญ๋Œ€ํ•™๊ต ๊ณต์ง€ ์Šคํฌ๋ž˜ํ•‘ ๋””์Šค์ฝ”๋“œ ๋ด‡

Notifications You must be signed in to change notification settings

c2lv/bampal2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๋ฐคํŒ”์ด

๐Ÿ˜ ์ฑ„๋„ ์ž…์žฅํ•˜๊ธฐ
bampal2_app_icon

๋งค์ผ ์˜คํ›„ 6์‹œ๋งˆ๋‹ค ๋‹น์ผ ์˜ฌ๋ผ์˜จ ๋™๊ตญ๋Œ€ํ•™๊ต ํ™ˆํŽ˜์ด์ง€์˜ ์ผ๋ฐ˜/ํ•™์‚ฌ/์žฅํ•™ ๊ณต์ง€๋ฅผ ์•Œ๋ ค์ฃผ๋Š” dgu-notice-bot์ด 2022๋…„ 3์›” 2์ผ ๋™๊ตญ๋Œ€ํ•™๊ต ํ™ˆํŽ˜์ด์ง€ ๊ฐœํŽธ๊ณผ ๊ด€๋ฆฌ์ž ๊ฐœ์ธ ์‚ฌ์ •์œผ๋กœ ์ธํ•ด ์•Œ๋ฆผ ์„œ๋น„์Šค๋ฅผ ์ข…๋ฃŒํ•˜๊ฒŒ ๋˜์–ด, ๊ฐœํŽธ๋œ ํ™ˆํŽ˜์ด์ง€์— ๋งž๊ฒŒ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜๊ณ  ์ƒˆ๋กญ๊ฒŒ ๋งŒ๋“  ๋””์Šค์ฝ”๋“œ ๊ณต์ง€๋ด‡.

๊ธฐ์กด๊ณผ ๋™์ผํ•˜๊ฒŒ ์ฑ„๋„ ๋ฉ”์‹œ์ง€๋ฅผ ํ†ตํ•ด ๊ณต์ง€๋ฅผ ์•Œ๋ ค์ฃผ๋ฉฐ, ์‚ฌ์šฉ์ž ์ฑ„๋„๊ณผ ๋ช…๋ น์–ด ๋“ฑ์ด ์ถ”๊ฐ€๋˜์—ˆ๋‹ค.

Environment

OS: Window 10

๊ธฐํƒ€ ์‚ฌ์šฉ๋œ ํŒจํ‚ค์ง€ ์ „์ฒด๋Š” requirement.txt๋ฅผ ํ†ตํ•ด ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Running the server locally

  1. Clone this repository.
git clone https://github.com/c2lv/bampal2.git
  1. Change directory and activate virtualenv.
cd bampal2
pip3 install virtualenv
virtualenv "Enter Your Virtual Environment Name"
source "Enter Your Virtual Environment Name"/Scripts/activate
  1. Add Discord bot token in BOT_TOKEN (Config Var).
export BOT_TOKEN="Enter Your Discord Bot Token"
  1. Install the requirements.
pip3 install -r requirements.txt
  1. Set channel ID in const.py
  2. Run discord_bot.py file.
python3 discord_bot.py

Reference

[DiscordBot] ํŒŒ์ด์ฌ์œผ๋กœ ๋””์Šค์ฝ”๋“œ ๋ด‡ ๋งŒ๋“ค๊ธฐ -1~2

๋””์Šค์ฝ”๋“œ ์ฑ„๋„ ์•„์ด๋”” ์•Œ์•„๋‚ด๊ธฐ

์‚ฌ์ดํŠธ ์ •๋ณด ์ถ”์ถœํ•˜๊ธฐ - beautifulsoup ์‚ฌ์šฉ๋ฒ• (1~2)

๋””์Šค์ฝ”๋“œ ๋ด‡ ๊ฐ•์ขŒ - 1~5ํŽธ, ๋ฒˆ์™ธํŽธ

Send a message to a Discord channel at a certain time once a week

๋ช…๋ น์–ด ์—๋Ÿฌ์ฒ˜๋ฆฌ

Cog

ํ—ค๋กœ์ฟ  ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •ํ•˜๊ณ  ํŒŒ์ด์ฌ์—์„œ ์‚ฌ์šฉํ•˜๊ธฐ

ํ—ค๋กœ์ฟ  ๋ฌด๋ฃŒ์‹œ๊ฐ„ 1000์‹œ๊ฐ„์œผ๋กœ ๋Š˜๋ฆฌ๊ธฐ

Heroku ๋กœ๊ทธ๋ณด๊ธฐ

Heroku์— ๋กœ๊ทธ์ธ ๋œ ์ƒํƒœ์—์„œ Terminal์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž…๋ ฅ

heroku logs -a [์•ฑ์ด๋ฆ„]

์ตœ๊ทผ 150์ค„์„ ์ถœ๋ ฅํ•˜๊ณ  ์‹ถ์„ ๋•Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž…๋ ฅ (-n ์˜ต์…˜์ด ์—†์„ ๊ฒฝ์šฐ ์ตœ๊ทผ 100์ค„์„ ์ถœ๋ ฅ)

heroku logs -n 150

๋””์Šค์ฝ”๋“œ ์—…๋ฐ์ดํŠธ ๊ด€๋ จ ๋ณ€ํ™” ๊ด€๋ จ ์ •๋ณด

Problem

  • API๊ฐ€ ๋ฐ˜ํ™˜ํ•œ ๊ฐ’์„ ์–ด๋–ป๊ฒŒ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š”์ง€, ์–ด๋–ป๊ฒŒ ํ•ด๊ฒฐํ•ด์•ผ ํ•˜๋Š” ์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ๋‹ค.
    ํ•ด๋‹น ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ๋ด‡์ด ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋ฅผ ์ถœ๋ ฅํ•˜๋„๋ก on_command_error() ๋‚ด๋ถ€์— ์กฐ๊ฑด๋ฌธ์„ ํ•˜๋‚˜ ์ถ”๊ฐ€ํ–ˆ๋‹ค.
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): 
You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. 
Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.

About

๐Ÿ˜ ๋™๊ตญ๋Œ€ํ•™๊ต ๊ณต์ง€ ์Šคํฌ๋ž˜ํ•‘ ๋””์Šค์ฝ”๋“œ ๋ด‡

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published