You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Please either provide code in the command, attach a file, or '
193
+
'react to a message that contains a file.')))
194
+
asyncwithself.bot.http._HTTPClient__session.post(
195
+
'https://mystb.in/documents', data=code) asr:
176
196
res=awaitr.json()
177
197
key=res["key"]
178
-
embed=ctx.embed(title="Mystb.in Link", description='I pasted your code into a bin, click on the title access it!', url=f'https://mystb.in/{key}').set_thumbnail(url='https://cdn.discordapp.com/avatars/569566608817782824/14f120e096fb515d770eea38f9cddd88.png')
awaitasyncio.sleep(2) # allow jsk git pull to finish before restarting
27
+
awaitasyncio.sleep(2) # allow jsk git pull to finish
27
28
restart=self.bot.get_command('restart')
28
29
awaitctx.invoke(restart)
29
30
30
31
@commands.command(name='restart')
31
32
asyncdef_restart(self, ctx, flag=None):
32
33
"""
33
-
Restart the bot. Will wait for any running commands to stop. Use --force to ignore any running commands and proceed with the restart
34
+
Restart the bot. Will wait for any running commands to stop (if
35
+
--force is not used).
34
36
"""
35
37
ifnot (flag=='--force'orflag=='-f'):
36
38
ifself.bot.processing_commands>1:
37
-
embed=discord.Embed(title='Commands in progress...', description=f'Retrying in 30 seconds. Use `{ctx.prefix}restart --force` to force restart.', timestamp=ctx.message.created_at)
38
-
embed.set_footer(text=f'{self.bot.processing_commands-1} commands currently in progess')
39
+
embed=discord.Embed(
40
+
title='Commands in progress...',
41
+
description=(f'Retrying in 30 seconds. Use `{ctx.prefix}'
embed=discord.Embed(title='Commands in progress...', description=f'Retrying in 30 seconds. Use `{ctx.prefix}restart --force` to force restart.', timestamp=ctx.message.created_at)
44
-
embed.set_footer(text=f'{self.bot.processing_commands-1} commands currently in progess')
50
+
embed=discord.Embed(
51
+
title='Commands in progress...',
52
+
description=('Retrying in 30 seconds. Use `'
53
+
f'{ctx.prefix}restart --force` to '
54
+
'force restart.'),
55
+
timestamp=ctx.message.created_at)
56
+
embed.set_footer(
57
+
text=(f'{self.bot.processing_commands-1} '
58
+
'commands currently in progess')
59
+
)
45
60
awaitctx.send(embed=embed)
46
61
else:
47
62
break
48
63
ifself.bot.processing_commands>1:
49
-
embed=discord.Embed(title='Restart Failed', description=f'{self.bot.processing_commands-1} commands currently in progess. Use `{ctx.prefix}restart --force` to force restart.', timestamp=ctx.message.created_at)
awaitctx.send(embed=ctx.error('Failed to stop systemd service, attempting to shut down both services'))
91
-
os.system(f'sudo stopall')
122
+
awaitctx.send(embed=ctx.error((
123
+
'Failed to stop systemd service, attempting to shut down both '
124
+
'services'
125
+
)))
126
+
os.system('sudo stopall')
92
127
awaitasyncio.sleep(1)
93
-
awaitctx.send(embed=ctx.error('Failed to stop systemd service, attempting to logout normally'))
128
+
awaitctx.send(embed=ctx.error((
129
+
'Failed to stop systemd service, attempting to logout normally'
130
+
)))
94
131
awaitself.bot.logout()
95
132
96
133
@commands.command(name='disable')
97
134
asyncdef_disable(self, ctx, toggle: bool=None):
98
135
"""
99
-
Disable the bot in case of an exploit, major bug, or other emergency. The bot will remain online, but only bot owners will be able to run commands on it
136
+
Disable the bot in case of an exploit, major bug, or other emergency.
137
+
The bot will remain online, but only bot owners will be able to run
return_embed.set_footer(icon_url=self.bot.user.avatar_url,text=f'If you think this is a mistake please contact {self.bot.get_user(self.bot.owner_ids[0])}')
0 commit comments