vortimassive.blogg.se

Icon bot command discord
Icon bot command discord









  1. #Icon bot command discord how to#
  2. #Icon bot command discord code#

#Icon bot command discord code#

Our code will look like this to add a field: embed.add_field(name= "Field 1 Title", value= "This is the value for field 1. Inline: boolean specifying whether the field is inline

icon bot command discord icon bot command discord

Value: a string with the body text of the field Name: a string with the title of the field There are 3 arguments that this method can take that you need to know about: When creating embeds, you have the ability to create a number of text fields with more information. Simple as that, our embed now has a thumbnail at the to right. In action, it will look like this: t_thumbnail(url= "")

  • url: a string with the URL location of the picture to use for the embed picture.
  • set_thumbnail() method takes a single argument that we need to know about: set_thumbnail() method on our initial embed object. This is the image that goes at the top right of the embed. Our next step will be to add the thumbnail. set_author method is updated, you will see that the icon and author name are updated to match the person who called the embed function. _url will retrieve the URL of their avatar to use in the embed (changes in bold). _name will pull the username (or nickname if they have one set for the guild) of the person who used the embed command. If you want the author name and icon to be the person who called the command, you can pull that information from the ctx, or context of the command. Running the bot and using the command in Discord will return the embed with the author information filled in. In action, this will look something like this: t_author(name= "RealDrewData", url= "", icon_url= "") Icon_URL: a string with the URL location of the picture to use in the author icon Url: a string with a link for the author text For the author, there are 3 arguments to know: set_author() method on it to add the information for the author. Once we have our initial embed object, we can use the. The author is the text at the very top, and the icon is the circle next to that.

    #Icon bot command discord how to#

    To turn the example blue, you would change it like this (change in bold): async def embed( ctx):Įmbed=discord.Embed(title= "Sample Embed", url= "", description= "This is an embed that will show how to build an embed and the different components", color=**()**)Ī full list of the color classmethods available for color in Discord.py are available in the documentation. To use the built in colors, you just use the classmethod of that color's name. You can continue to look up HEX color codes with a tool like Google's Color Picker, or you can use the built in colors inside discord.Color. You have multiple options when it comes to colors. Go to the server where you joined your bot. In the command build the initial embed object like so: async def embed( ctx):Įmbed=discord.Embed(title= "Sample Embed", url= "", description= "This is an embed that will show how to build an embed and the different components", color= 0xFF5733) All this command will do is build the embed and send it to the channel. Let's create a new command in the bot code. This will color the left edge of the embed. This is the darker 2 red lines aboveĬolor: a color object. When you click on title in the final embed it will take you to this linkĭescription: a string to set the description. Url: a string to set the link for the title. This is the first line on our blank embed We will be using 4 arguments to get started: When creating an embed, you need to initialize an embed object using the Embed() function from the discord package. Title, Description, and color (color is the bar to the left side) You'll know how to make this embed by the end of the tutorial! There are multiple pictures, links, and text fields that we are able to edit. The embed below is similar to what we will be making. In this tutorial we will go through how to create an embed and customize every part of it. Building EmbedsĮmbeds in Discord are simple and have a very clean, formatted look to them.

    icon bot command discord

    It is recommended that you migrate your code to a more current version. You will encounter issues if you are using a version lower than 1.0. Note: This is tested on version 1.4.1 of the Discord.py module. Python Discord Bots: Formatting Text: How to add rich formatting to Python Discord bots With Python and Discord.py, this is super easy to do in your Discord bot! Maybe you have links or images that you want to send back in chat. When your Discord bot responds to your server, you don't always want a boring default message to be sent back. LinkedIn logo for sharing a link Twitter logo for sharing a link Reddit logo for sharing a link











    Icon bot command discord