Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

discord - how do i edit my bot which help in posting community pokemoon coords

How to add message.content like the message I get from another channel and make it in description in embeds?
The problem is I am not able to add every description like it only gives the text beside the pokemon name.

import discord
from discord.ext import commands
import asyncio
import json
    
    
######################---Do Not Touch tHIS---#########################
with open('./configuration.json') as r:                             ##
    config = json.load(r)                                           ##
                                                                    ##
bot_token = config["bot_token"]                                     ##
bot_prefix = config["bot_prefix"]                                   ##
                                                                    ##
feeds_channel_id = config["feeds_channel_id"]                       ##    
destination_channel_id = config["destination_channel_id"]           ##
                                                                    ##            
embed_footer = config["embed_footer"]                               ##
embed_footer_ka_icon_url = config["embed_footer_ka_icon_url"]       ##
######################---Do Not Touch tHIS---#########################

client = commands.Bot(command_prefix=bot_prefix)
    
@client.event
async def on_message(message):
    """Helps to Post Community Spawns"""
    if message.channel.id == feeds_channel_id:
        q = (message.content.split(' '))
        pokemon_upper =  q[0].upper()
        pokemon_lower = q[0].lower()
        coordinates = q[1] 
        embed=discord.Embed(title=pokemon_upper, description="Coords -> {}".format(coordinates))
        embed.set_thumbnail(url=f"http://play.pokemonshowdown.com/sprites/ani-shiny/{pokemon_lower}.gif")
        embed.set_footer(text=embed_footer,icon_url=embed_footer_ka_icon_url)
        await client.get_channel(destination_channel_id).send(content=coordinates,embed=embed)
        return
    else:
        return        
    
client.run(bot_token)
question from:https://stackoverflow.com/questions/65830350/how-do-i-edit-my-bot-which-help-in-posting-community-pokemoon-coords

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...