team-crescendo / discord-py-boilerplate

A template for developing discord chatbot with discord.py library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord Chatbot Template

단순한 기능의 디스코드 챗봇을 구현하는 데 적합한 소스 코드 템플릿입니다.

Getting Started

Prerequisite

이 프로젝트는 Python으로 챗봇을 개발하는 사람을 위해 구성되었습니다. async / await 구문을 사용하기 위해 최소 Python 3.7 이상의 개발 환경이 필요합니다.

통합 개발 환경(IDE)으로는 VSCode를 권장합니다. VSCode 사용자의 경우, 워크스페이스 전용 설정을 다음과 같이 불러옵니다.

$ cd .vscode
$ cp settings.example.json settings.json

Installing

해당 템플릿을 운영하기 위해 필요한 패키지를 설치합니다.

$ pip install -r requirements.txt

디스코드 봇을 운영하기 위해서는 봇 계정(토큰)이 필요합니다. 디스코드 개발자 사이트에서 봇 토큰을 발급받은 뒤 이를 형식에 맞춰 .env에 넣습니다. .env 양식은 .env.example을 참고하여 작성할 수 있습니다.

$ echo "BOT_TOKEN=your.bot.token" >> .env

Deployment

챗봇을 운영할 서버에 git 저장소를 생성하고, 다음 스크립트를 실행합니다.

$ nohup python src/bot.py &

Built with

  • discord.py - 디스코드 봇 API 래퍼
  • Black - 파이썬 코드 포매터
  • flake8 - 파이썬 린터
  • isort - 파이썬 import문 정렬 라이브러리

Authors

License

This project is licensed under the MIT License - see the LICENSE for the details

About

A template for developing discord chatbot with discord.py library

License:MIT License


Languages

Language:Python 99.0%Language:Shell 1.0%