Use the package manager pip to install the following packages.
Important: Some cases you need to use pip3 instead of pip
pip install nextcord
pip install asyncio
pip install PyNaCl
- Add the image to the folder
assets/images/
Note: The image must be in
.jpg
format, if the image is in another format, you must change the extension in the code or the extention in the image
async def sendImage(ctx, image):
await ctx.send(file=nextcord.File(f'./assets/images/{image}.jpg'))
- Change the
imageTest
with the name you gave to the image
Note: The name of the image must be the same as the name of the command,
do not include the file extension
@bot.command(name = 'imagetest')
async def image(ctx):
await sendImage(ctx, 'imageTest')
- Add the audio to the folder
assets/audios/
Note: The audio must be in
.mp3
format, if the audio is in another format, you must change the extension in the code or the extention in the audio
source = FFmpegPCMAudio('./assets/audios/{name}.mp3')
- Change the
audioTest
with the name you gave to the audio - Change
6
with the duration of the audio.
Note: The duration of the audio must be in seconds
@bot.command(name = 'audioTest')
async def sendAudio(ctx):
await playAudio(ctx, 'audioTest', 6)
- Change the
textMessage
with the text you want to send
Note: both the
@bot.command
textTest
is the comand the bot will use to send the text, thetextMessage
is the message the bot will send when the command is used
@bot.command(name = 'textTest')
async def message(ctx):
await sendMessage(ctx, 'textMessage')
- Change the
token
with the token of your bot. If you don't know how to get the token, click here
bot.run('Your token')