Discord.py bot tutorial (EXPLAINED IN COMMENTS)
A basic bot tutorial in discord.py with ban, kick, status, latency and others
EXPLAINED:
import datetime
import disnake
import discord
from discord.ext import commands
^^^
These are all the libraries that we import if you do not have them install them with pip (pip3)
bot = commands.Bot(command_prefix="!",intents=intents, activity=discord.Activity(type=discord.ActivityType.listening, name="Port 8080"), status=discord.Status.idle)
intents = discord.Intents.all()
^^^
Here we define the bot and it's intents (what it intends to do)
this is important as without defining the bot it won't work
@bot.command()
async def status(send):
await send.send("Bot is running")
await send.send('Latency is: {0}'.format(round(bot.latency, 1)))
^^^
@bot.command() starts the command
async def status(send): defines what the command is gonna be called and some other variables and stuff
await send.send("Bot is running")
await send.send('Latency is: {0}'.format(round(bot.latency, 1))) -- these functions send out a message in the channel the command is ran in
Other Videos By YourLocalDeveloper
2023-11-13 | Ark Survival Evolved Ragnarok Map 1 |
2023-08-21 | Minecraft with shaders (survival) |
2023-08-21 | Code1 |
2023-08-17 | Incident 13 Medkit, bandage, pistol and body armor models |
2023-08-17 | Incident 13 Demo |
2023-07-06 | Titanfall 2 campaign part 1 |
2023-07-05 | Titanfall 2 campaign part 1 |
2023-07-05 | Titanfall 2 Last Titan Standing |
2023-05-12 | Test |
2023-05-12 | Test |
2023-05-12 | Discord.py bot tutorial (EXPLAINED IN COMMENTS) |
2023-01-21 | Team Fortress 2 - Man vs Machine Pyro Madness |
2022-08-04 | Warzone |
2022-08-04 | Warzone |
2022-08-04 | Cod Warzone Stream |