Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Здраствуйте! Сегодня я покажу код для написания бота discorda.Но для начала используйте библиотеку пайтона pip install discord.py :)
- import discord
- from discord.ext import commands
- client = commands.Bot( command_prefix = '.')
- # .hello
- @client.event
- async def on_ready():
- print( 'BOT connected' )
- @client.command( pass_context = True)
- async def hello( ctx ):
- author = ctx.message.author
- await ctx.send( f' { author.mention } Hello. I am are BOT for discord' )
- # Connect
- token = open( 'token.txt', 'r' ).readline()
- client.run( token )
- токен вписываете в отдельный txt документ!
- И также создаете файл server.bat и пишите там это:
- @echo off
- python названия бота .py
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement