Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wamy-Dev committed Aug 7, 2022
1 parent a702e4e commit 4c2e59e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ async def index():
intents.members = True
client = commands.Bot(command_prefix = '$', intents=intents)
client.remove_command('help')
#Putting all repeated lines in a function
def convert_command_embeds(link:str,author:discord.User):
embed = discord.Embed(title = "Here is your converted link!", colour = discord.Colour.from_rgb(4,132,188))
embed.set_author(name = author, icon_url = author.avatar.url)
embed.add_field(name = '🔗', value="https://"+link if not link.startswith("https://") else link, inline = False)
embed.set_footer(text = "If you like this project please donate using $donate in the server.")
sendembed = discord.Embed(title = "Please check your DMs!", colour = discord.Colour.from_rgb(4,132,188))
sendembed.set_author(name = author, icon_url = author.avatar.url)
sendembed.set_footer(text = "If you like this project please donate using $donate in the server.")
return embed,sendembed

@client.event
async def on_ready():
print(f'Bot is ready. Logged in as {client.user}(ID: {client.user.id}) ')
Expand All @@ -65,6 +56,16 @@ async def project(ctx):
await ctx.send(embed = embed)
@client.command(aliases = ['decode', 'converts'])
async def convert(ctx, arg=None):
def convert_command_embeds(link:str,author:discord.User):
#Thanks @ItsZabbs for this code snippet
embed = discord.Embed(title = "Here is your converted link!", colour = discord.Colour.from_rgb(4,132,188))
embed.set_author(name = author, icon_url = author.avatar.url)
embed.add_field(name = '🔗', value="https://"+link if not link.startswith("https://") else link, inline = False)
embed.set_footer(text = "If you like this project please donate using $donate in the server.")
sendembed = discord.Embed(title = "Please check your DMs!", colour = discord.Colour.from_rgb(4,132,188))
sendembed.set_author(name = author, icon_url = author.avatar.url)
sendembed.set_footer(text = "If you like this project please donate using $donate in the server.")
return embed,sendembed
def check(msg):
return msg.author == ctx.author and msg.channel == ctx.channel
if (arg):
Expand Down Expand Up @@ -189,6 +190,5 @@ def run(self):
self.name = 'Discord.py'
self.loop.create_task(self.starter())
self.loop.run_forever()
#discord_thread = async_discord_thread()
#app.run(host="0.0.0.0")
client.run(CLIENTTOKEN)
discord_thread = async_discord_thread()
app.run(host="0.0.0.0")

0 comments on commit 4c2e59e

Please sign in to comment.