Skip to content

Commit

Permalink
revert back to main version
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev committed Nov 29, 2024
1 parent 93cb987 commit e93ff00
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
25 changes: 20 additions & 5 deletions bridge_revolt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,22 @@ async def restart_revolt(self, ctx):
@commands.command(name='fix-revolt', hidden=True)
@restrictions_legacy.owner()
async def fix_revolt(self, ctx):
"""Fixes Revolt permissions check bug by switching to a patched version. You only need to run this once."""
"""Revolt.py has been fixed, there's no reason to use this."""
embed = nextcord.Embed(
title='Revolt.py has been fixed!',
description=(
'Our [pull request](https://github.com/revoltchat/revolt.py/pull/89) was merged to the main '+
'repository, meaning you don\'t need to use our patched version anymore.\n\n'+
f'To switch back to the upstream version, run `{self.bot.command_prefix}rollback-revolt`.'
),
color=self.bot.colors.success
)
await ctx.send(embed=embed)

@commands.command(name='rollback-revolt', hidden=True)
@restrictions_legacy.owner()
async def rollback_revolt(self, ctx):
"""Switches back to using the upstream version of Revolt.py."""
with open('boot_config.json') as file:
boot_config = json.load(file)

Expand All @@ -1430,22 +1445,22 @@ async def fix_revolt(self, ctx):
else:
binary = 'python3'

msg = await ctx.send(f'{self.bot.ui_emojis.loading} Fixing...')
msg = await ctx.send(f'{self.bot.ui_emojis.loading} Reverting...')

# Attempt to purge cache, it's ok if this fails
await self.bot.loop.run_in_executor(None, lambda: os.system(f'{binary} -m pip cache purge'))

# Attempt to install
code = await self.bot.loop.run_in_executor(
None, lambda: os.system(
f'{binary} -m pip install{user_option} --force https://github.com/greeeen-dev/revolt.py/archive/refs/heads/master.zip'
f'{binary} -m pip install{user_option} --force https://github.com/revoltchat/revolt.py/archive/refs/heads/master.zip'
)
)

if code > 0:
await msg.edit(content=f'{self.bot.ui_emojis.error} Could not install the patched version.')
await msg.edit(content=f'{self.bot.ui_emojis.error} Could not install the main version.')
else:
await msg.edit(content=f'{self.bot.ui_emojis.success} Installed patch version! Please reboot the bot.')
await msg.edit(content=f'{self.bot.ui_emojis.success} Installed main version! Please reboot the bot.')

def setup(bot):
bot.add_cog(Revolt(bot))
13 changes: 3 additions & 10 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"id": "revolt",
"name": "Revolt Support",
"description": "Unifier Revolt Support extension",
"version": "v1.3.10",
"release": 40,
"version": "v1.3.11",
"release": 41,
"minimum": 58,
"services": [
"bridge_platform"
],
"bridge_platform": "revolt",
"shutdown": true,
"requirements": [
"https://github.com/greeeen-dev/revolt.py/archive/refs/heads/master.zip",
"https://github.com/revoltchat/revolt.py/archive/refs/heads/master.zip",
"ulid-py",
"typing-extensions",
"aenum"
Expand All @@ -24,13 +24,6 @@
"license": "MIT",
"license_url": "https://github.com/revoltchat/revolt.py/blob/master/LICENSE"
},
"revolt.py (patched)": {
"author": "greeeen-dev",
"description": "Python wrapper for https://revolt.chat",
"repo": "https://github.com/greeeen-dev/revolt.py",
"license": "MIT",
"license_url": "https://github.com/greeeen-dev/revolt.py/blob/master/LICENSE"
},
"ulid-py": {
"author": "Andrew Hawker",
"description": "Universally Unique Lexicographically Sortable Identifier (ULID) in Python 3",
Expand Down

0 comments on commit e93ff00

Please sign in to comment.