mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 10:03:40 +01:00
Don't allow bots to end breaks
This commit is contained in:
parent
59c23c1149
commit
aacff7403f
1 changed files with 23 additions and 1 deletions
|
@ -129,7 +129,7 @@ class McDonaldsCog(commands.Cog):
|
|||
delete_after=30
|
||||
)
|
||||
await db.set_break(author.id, message.created_at.timestamp())
|
||||
else:
|
||||
elif message.author.bot is False:
|
||||
await db.remove_break(author.id)
|
||||
await message.reply(
|
||||
"Thank you. You may now resume your activity.",
|
||||
|
@ -171,6 +171,28 @@ class McDonaldsCog(commands.Cog):
|
|||
await ctx.respond("Commercial break started.", ephemeral=True)
|
||||
await ctx.delete(delay=120)
|
||||
|
||||
@commands.command(name="commercial-break")
|
||||
@commands.is_owner()
|
||||
async def _force_com_break(self, ctx: commands.Context, *, member: discord.Member):
|
||||
"""Forces a member to go on commercial break."""
|
||||
async with McDataBase() as db:
|
||||
await db.set_break(member.id, discord.utils.utcnow().timestamp())
|
||||
await ctx.reply(
|
||||
f"{member.mention} Commercial break! Please say `MCDONALDS!` to end commercial.\n"
|
||||
f"*This commercial break is sponsored by {ctx.author.mention}.*",
|
||||
delete_after=300,
|
||||
allowed_mentions=discord.AllowedMentions(users=True, roles=False, everyone=False)
|
||||
)
|
||||
await ctx.message.delete(delay=120)
|
||||
|
||||
@commands.command(name="end-break")
|
||||
@commands.is_owner()
|
||||
async def _unforce_com_break(self, ctx: commands.Context, *, member: discord.Member):
|
||||
"""Forces a member to finish their commercial break."""
|
||||
async with McDataBase() as db:
|
||||
await db.remove_break(member.id)
|
||||
await ctx.reply(f"{member.mention} Commercial break ended.", delete_after=10)
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(McDonaldsCog(bot))
|
||||
|
|
Loading…
Reference in a new issue