I have finally made the bot
update itself with a command.
Please note if the python program
does crash I can't update it.
Here is the code.
This stack overflow problem
helped me. Link to solution.
g = git.cmd.Git("DIRECTORY FOR THE BOT!")
@bot.command()
@commands.is_owner()
async def updateGithub(ctx):
"""Updates the bot from the private github."""
await ctx.message.delete()
msg=g.pull()
print(msg)
channel=bot.get_channel(generalId)
await channel.send(msg)
if __name__ == '__main__':
os.execv(sys.executable, ['python'] + sys.argv)
I made it update with github yesterday.
I'm honestly stuck on what my plan for this page
is. I might just use this to record random stuff
I add to this discord bot. I'm not sure if I'm ready
to share the discord server it is in ,or even the source
code.
I am going to try to make an interesting and cool discord
bot on ,you guessed it, my raspberry pi 4. I want it to
get random youtube videos and maybe make a database with
hashmaps and other cool junk. For now I want to research
making it automatically update with github because I want
to code on my laptop.