Hello, I am trying to add fields to the embeds but i don’t know how with the code i have used, i am using replit to host the bot
Code
#imports and other inportant stuff
import os
import discord
from keep_alive import keep_alive
import asyncio
from discord.ext.commands import Bot
from discord.ext import commands
client = commands.Bot(command_prefix = 'b!')
#when bot is online
@client.event
async def on_ready():
#activity
await client.change_presence(activity=discord.Game(name="Coming Soon"))
#print in console
print("Bot is ready!")
#messages
@client.event
async def on_message(message):
if message.author == client.user:
return
msg = message.content
if msg.startswith('*embedexample'):
await message.channel.send (embed=discord.Embed(title="Embeds", url="https://solo.to/blurp", description="Currently we are working on Embeds and implementing them properly, they are currently not working as intended", color=0x109319))
if msg.startswith('*invite'):
await message.channel.send('||https://discord.com/oauth2/authorize?client_id=901046599382347807&scope=bot&permissions=8||')
if msg.startswith('*testembed'):
await message.channel.send (embed=discord.Embed(title="Test", url="https://solo.to/blurp", description="This is a Test for embeds. We are currently trying to test Fields", color=0x109319))
if msg.startswith('*help'):
await message.channel.send (embed=discord.Embed(title="Help", url="https://solo.to/blurp", description="type *embedhelp for embed commands, type *moderationhelp for moderation commands", color=0x109319))
if msg.startswith('*embedhelp'):
await message.channel.send (embed=discord.Embed (title="Embed Help", url="https://solo.to/blurp", description="Type *embedexample for a example of the embeds, type *testembed to test the embed that we are working on"))
if msg.startswith('*moderationhelp'):
await message.channel.send (embed=discord.Embed (title="Moderation Help", url="https://solo.to/blurp", description="coming soon"))
@client.command(pass_context=True)
async def embed(ctx):
channel = ctx.message.channel
embed = discord.Embed(
title = 'Title',
description = 'This is a description',
colour = discord.Colour.blue()
)
embed.set_footer(text='This is a footer.')
embed.set_image(url='https://hatrabbits.com/wp-content/uploads/2017/01/random.jpg')
embed.set_thumbnail(url='https://hatrabbits.com/wp-content/uploads/2017/01/random.jpg')
embed.set_author(name='Author Name', icon_url='https://hatrabbits.com/wp-content/uploads/2017/01/random.jpg')
embed.add_field(name='Field Name', value='Field Value', inline=False)
embed.add_field(name='Field Name', value='Field Value', inline=True)
await client.send_message(channel, embed=embed)
keep_alive()
client.run(os.getenv('TOKEN'))
Please let me know how it could be done. Thankyou