Skip to content

Commit

Permalink
necessary update
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmsj committed Feb 20, 2022
1 parent be5a546 commit 2e91833
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 7 additions & 1 deletion help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command>` 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]")
Expand Down
18 changes: 14 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="💅"
)


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 2e91833

Please sign in to comment.