본문 바로가기
반응형

프로젝트/디스코드 봇7

[Python] #2 디스코드 봇 만들기 - 명령어 목차 명령어를 입력하고 메시지를 받아보겠습니다. Discord.py 설치 터미널에 pip install discord 코드 import discord from discord.ext import commands bot = commands.Bot(command_prefix='$') # 접두사가 '$' @bot.event async def on_ready(): print('We have logged in as {0.user}'.format(bot)) @bot.command() async def hello(ctx):# '$hello'라는 메시지를 보냈을 때 @이름 Hello!를 보내줌 await ctx.send('{0.author.mention} Hello!'.format(ctx)) bot.run('token'.. 2021. 7. 10.
[Python] #1 디스코드 봇 만들기 - 봇 생성 목차 디스코드 봇을 생성하고 서버에 추가할 것입니다. 봇 생성 아래 링크로 접속 후 https://discord.com/developers/applications Discord Developer Portal — API Docs for Bots and Developers Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with. discord.com New Application 클릭 이름을 적고 Create 왼쪽 메뉴에서 Bot 클릭 후 Add Bot Yes, do it! 을 누르면 봇이 추가됩니다. 서버에 추가 왼쪽 메뉴에서 OAuth2 클릭 후 .. 2021. 7. 6.
[Python] #0 디스코드 봇 만들기 - 소개 및 준비 목차 개요 한창 리그 오브 레전드를 많이 했을 때 일반 게임에서 재미로 무작위로 걸리는 챔피언을 선택해 게임을 했었습니다. 라인, 룬, 아이템, 챔피언을 무작위로 추천해주는 디스코드 봇을 만들겠습니다. 이름은 롤 뉴메타 추천 봇으로 하겠습니다. 디스코드 봇을 만드는 방법에는 여러가지가 있는데 그중에서 discord.py를 사용하여 만들겠습니다. 준비 디스코드 계정 만들기 https://discord.com/ Discord | Your Place to Talk and Hang Out Discord is the easiest way to talk over voice, video, and text. Talk, chat, hang out, and stay close with your friends and com.. 2021. 7. 5.
728x90
반응형