import discord
from discord.ext import commands
from discord.ui import Button, View, Select
class changelog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def changelog(self, ctx):
# >>> EMBED VERSION 0.2.0ALPHA <<< #
embedv020a = discord.Embed(title="Changelog", description="Changes i made to the bot.", color=0x00ff00)
embedv020a.add_field(name="0.2.0alpha", value="", inline=False)
embedv020a.add_field(name="", value="- Added JSON file with settings", inline=False)
embedv020a.add_field(name="", value="- Added a seperate file for changelog commands", inline=False)
embedv020a.add_field(name="", value="- Just for me tho", inline=False)
embedv020a.add_field(name="", value="- Added commands", inline=False)
embedv020a.add_field(name="", value="- $kick (Kicks a user), $ban (Bans a user for a specified duration in days), $joinchannel (Set up the Join Channel) $leavechannel (Set up the Leave Channel)", inline=False)
embedv020a.add_field(name="Coming Soon!", value="Now i will add features that im working on and will become available soon!", inline=False)
embedv020a.add_field(name="Coming in Version 0.3.0", value="", inline=False)
embedv020a.add_field(name="", value="- More moderation commands ($mute, $clear etc.)", inline=False)
embedv020a.add_field(name="", value="- Fun commands! (There will be something but i dont know what)", inline=False)
embedv020a.add_field(name="", value="- Fixing the Link Deleter (So it will filter out the bad ones and leave the good ones!)", inline=False)
embedv020a.add_field(name="Coming in Version 0.4.0", value="Maybe in the 0.3.0", inline=False)
embedv020a.add_field(name="", value="- Verification system (For protecting servers!)", inline=False)
embedv020a.add_field(name="", value="- Converting commands with lots of arguments into slash commands! (Not so sure about that)", inline=False)
embedv020a.add_field(name="", value="- Leaving alpha state of the bot! (Hopefully)", inline=False)
# >>> EMBED VERSION 0.1.6ALPHA <<< #
embedv016a = discord.Embed(title="Changelog", description="Changes i made to the bot.", color=0x00ff00)
embedv016a.add_field(name="0.1.6alpha", value="", inline=False)
embedv016a.add_field(name="", value="- Added command", inline=False)
embedv016a.add_field(name="", value="$changelog (Lists the latest and previous changes i made to the bot)", inline=False)
# >>> EMBED VERSION 0.1.5ALPHA <<< #
embedv015a = discord.Embed(title="Changelog", description="Changes i made to the bot.", color=0x00ff00)
embedv015a.add_field(name="0.1.5alpha", value="", inline=False)
embedv015a.add_field(name="", value="- Added cogs", inline=False)
embedv015a.add_field(name="", value="- basic.py (Basic commands), fun.py (Fun commands to play with the bot **WIP**), moderation.py (Moderation commands kick, ban etc. **WIP**)", inline=False)
embedv015a.add_field(name="", value="- Structural change of the bot", inline=False)
embedv015a.add_field(name="", value="- Added events.py (Profane word filter & links deleter)", inline=False)
# >>> EMBED VERSION 0.1.0ALPHA <<< #
embedv010a = discord.Embed(title="Changelog", description="Changes i made to the bot.", color=0x00ff00)
embedv010a.add_field(name="0.1.0alpha", value="", inline=False)
embedv010a.add_field(name="", value="- Added commands", inline=False)
embedv010a.add_field(name="", value="$hello (Greets you), $info (Gives info about the bot), $commands (List of all available commands)", inline=False)
embedv010a.add_field(name="", value="- Added Profanity Words filter and Links Deleter", inline=False)
options = [
discord.SelectOption(label="Version 0.1.0alpha", description="22/06/2024", value=embedv010a),
discord.SelectOption(label="Version 0.1.5alpha", description="23/06/2024", value=embedv015a),
discord.SelectOption(label="Version 0.1.6alpha", description="23/06/2024", value=embedv016a),
discord.SelectOption(label="Version 0.2.0alpha", description="24/06/2024", value=embedv020a)
]
async def callback(interaction: discord.Interaction):
selected_embed = select.values[interaction.data.values[0]]
await interaction.response.edit_message(embed=selected_embed)
select = Select(options=options)
select.callback = callback
view = View()
view.add_item(select)
await ctx.send(embed=embedv020a, view=view)
@commands.command
async def changelogt(self, ctx):
try:
embed = discord.Embed(title="Changelog", description="Changes i made to the bot.", color=0x00ff00)
embed.add_field(name="0.2.0alpha", value="", inline=False)
embed.add_field(name="", value="- Added JSON file with settings", inline=False)
embed.add_field(name="", value="- Added a seperate file for changelog commands", inline=False)
embed.add_field(name="", value="- Just for me tho", inline=False)
embed.add_field(name="", value="- Added commands", inline=False)
embed.add_field(name="", value="- $kick (Kicks a user), $ban (Bans a user for a specified duration in days), $joinchannel (Set up the Join Channel) $leavechannel (Set up the Leave Channel)", inline=False)
embed.add_field(name="Coming Soon!", value="Now i will add features that im working on and will become available soon!", inline=False)
embed.add_field(name="Coming in Version 0.3.0", value="", inline=False)
embed.add_field(name="", value="- More moderation commands ($mute, $clear etc.)", inline=False)
embed.add_field(name="", value="- Fun commands! (There will be something but i dont know what)", inline=False)
embed.add_field(name="", value="- Fixing the Link Deleter (So it will filter out the bad ones and leave the good ones!)", inline=False)
embed.add_field(name="Coming in Version 0.4.0", value="Maybe in the 0.3.0", inline=False)
embed.add_field(name="", value="- Verification system (For protecting servers!)", inline=False)
embed.add_field(name="", value="- Converting commands with lots of arguments into slash commands! (Not so sure about that)", inline=False)
embed.add_field(name="", value="- Leaving alpha state of the bot! (Hopefully)", inline=False)
await ctx.send(embed=embed)
except discord.HTTPException as e:
await ctx.send(f"An error occurred while sending the embed: {e}")
except Exception as e:
await ctx.send(f"An unexpected error occurred: {e}")
async def setup(bot):
await bot.add_cog(changelog(bot))
Here is my whole changelog.py file. The bot works properly, besides the “embedv020a” – it just doesn’t work. How can I fix this problem? The rest of embeds works fine, so does the changelog command.
I’m using python 3.12.4 on Windows 10.
I tried:
Changing the name of the variable. Using a different command and file to send the embed.
New contributor
user25690919 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.