From 2e918333df7ca8169230bc65337f935251bfa388 Mon Sep 17 00:00:00 2001 From: jsssofficial <67999970+jsmsj@users.noreply.github.com> Date: Sun, 20 Feb 2022 15:31:55 +0530 Subject: [PATCH] necessary update --- README.md | 2 ++ help.py | 8 +++++++- main.py | 18 ++++++++++++++---- secrets.py | 4 ++-- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f3a150b..98e1e42 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Gclone Discord Utilities +># This repo is only for selfhosting the bot on PC. For heroku Build see [this](https://github.com/jsmsj/Gclone-Discord-Utilities-Heroku) +--- ## Features 1. **Clone** - Clone a public/private google drive file/folder to your teamdrive. 2. **Mkdir** - Make Directories directly from discord. diff --git a/help.py b/help.py index 2aa57d9..76c6f66 100644 --- a/help.py +++ b/help.py @@ -12,10 +12,16 @@ async def help(self,ctx): helpEmbed = discord.Embed(title = 'Help is here', color = discord.Color.green(), description = f"Use `{secrets.PREFIX}help ` for extended information") helpEmbed.add_field(name= "Gclone Integration", value = "`clone`, `mkdir`, `size`, `move`, `sync`, `deltefolder`, `deletefile`") helpEmbed.add_field(name= "Admin Only", value= "`add`, `remove`", inline=False ) - helpEmbed.add_field(name= "Utility (Anyone can use)", value= "`ping`, `size`, `name`, `info`", inline=False ) + helpEmbed.add_field(name= "Utility (Anyone can use)", value= "`ping`, `size`, `name`, `info`, `source`", inline=False ) helpEmbed.set_footer(text="Made with 💘 by jsmsj#5252 using pycord. Inspired from Rekulous' CloneCord.") await ctx.send(embed= helpEmbed) + @help.command() + async def source(self,ctx): + helpEmbed = discord.Embed(title = 'Source Code', color = discord.Color.green(), description = "The Bot is open source.") + helpEmbed.add_field(name="**Syntax**", value = f"`{secrets.PREFIX}source`") + await ctx.send(embed = helpEmbed) + @help.command() async def clone(self,ctx): helpEmbed = discord.Embed(title = 'Clone', color = discord.Color.green(), description = "Clone a public or private google drive folder/file. Make sure your service accounts have access to the destination.\n[They also need to have access to the source incase you are cloning a private google drive file or folder]") diff --git a/main.py b/main.py index 8cf806d..4817bc1 100644 --- a/main.py +++ b/main.py @@ -129,7 +129,7 @@ async def clone(ctx,source=None,name=None, destination=secrets.DEFAULT_DESTINATI butt3 = Button( label="Gclone Command", style=discord.ButtonStyle.grey, - emoji="🔗" + emoji="💅" ) @@ -163,10 +163,11 @@ async def butt3call(interaction:discord.Interaction): if interaction.user != ctx.author: await interaction.response.send_message("This button is not for you",ephemeral=True) else: - butt1.disabled=True - butt1.style = discord.ButtonStyle.success + butt3.disabled=True + butt3.style = discord.ButtonStyle.success await interaction.response.edit_message(content=f"{ctx.author.mention}",embed=em,view=view) - await interaction.followup.send(f'gclone copy GC:"{d1}/{name}" "C:\\Users\\USERNAME\\Desktop\\{name} --progress"',ephemeral=True) + des = d1.replace('"','') + await interaction.followup.send(f'```py\ngclone copy GC:"{des}" "C:\\Users\\USERNAME\\Desktop\\{name}" --progress\n```',ephemeral=True) butt1.callback = butt1call butt2.callback = butt2call @@ -531,6 +532,15 @@ async def info(ctx): await ctx.send(embed=em) +@bot.command() +async def source(ctx): + em = discord.Embed(title="Source Code",description="You can also host the bot on Heroku",color=discord.Color.green()) + em.add_field(name="Made By",value="jsmsj#5252\n(DMs Open for recommendations.)") + em.add_field(name="Version",value=secrets.VERSION) + em.add_field(name="Bot Repository for Self Hosting",value="[Gclone Discord Utilities](https://github.com/jsmsj/Gclone-Discord-Utilities)",inline=False) + em.add_field(name="Bot Repository for Heroku",value="[Gclone Discord Utilities Heroku](https://github.com/jsmsj/Gclone-Discord-Utilities-Heroku)",inline=False) + + await ctx.send(embed=em) bot.load_extension('help') bot.run(secrets.TOKEN) diff --git a/secrets.py b/secrets.py index ba06886..d5229a3 100644 --- a/secrets.py +++ b/secrets.py @@ -23,10 +23,10 @@ ADMINS.append(int(admin)) -DESTINATION_ID = os.getenv("DESTINATION_ID") +DESTINATION_ID = os.getenv("DESTINATION_ID") VERSION = "1.5.0" #This is the bot version. It is recommended that you do not change it. from utils import getIdFromUrl -DEFAULT_DESTINATION_ID = getIdFromUrl(DESTINATION_ID) +DEFAULT_DESTINATION_ID = getIdFromUrl(DESTINATION_ID) \ No newline at end of file