mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
chore: change some bot colors and small changes
This commit is contained in:
@@ -1,17 +1,8 @@
|
|||||||
"""
|
|
||||||
Copyright © Krypton 2019-Present - https://github.com/kkrypt0nn (https://krypton.ninja)
|
|
||||||
Description:
|
|
||||||
🐍 A simple template to start to code your own and personalized Discord bot in Python
|
|
||||||
|
|
||||||
Version: 6.4.0
|
|
||||||
"""
|
|
||||||
|
|
||||||
import random
|
import random
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from discord.ext.commands import Context
|
from discord.ext.commands import Context
|
||||||
|
|
||||||
|
|
||||||
class Choice(discord.ui.View):
|
class Choice(discord.ui.View):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -24,14 +15,13 @@ class Choice(discord.ui.View):
|
|||||||
self.value = "heads"
|
self.value = "heads"
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
||||||
@discord.ui.button(label="Tails", style=discord.ButtonStyle.blurple)
|
@discord.ui.button(label="Tails", style=discord.ButtonStyle.red)
|
||||||
async def cancel(
|
async def cancel(
|
||||||
self, interaction: discord.Interaction, button: discord.ui.Button
|
self, interaction: discord.Interaction, button: discord.ui.Button
|
||||||
) -> None:
|
) -> None:
|
||||||
self.value = "tails"
|
self.value = "tails"
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
||||||
|
|
||||||
class CoinFlip(commands.Cog, name="coinflip"):
|
class CoinFlip(commands.Cog, name="coinflip"):
|
||||||
def __init__(self, bot) -> None:
|
def __init__(self, bot) -> None:
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
@@ -42,26 +32,33 @@ class CoinFlip(commands.Cog, name="coinflip"):
|
|||||||
async def coinflip(self, context: Context) -> None:
|
async def coinflip(self, context: Context) -> None:
|
||||||
"""
|
"""
|
||||||
Make a coin flip, but give your bet before.
|
Make a coin flip, but give your bet before.
|
||||||
|
|
||||||
:param context: The hybrid command context.
|
:param context: The hybrid command context.
|
||||||
"""
|
"""
|
||||||
buttons = Choice()
|
buttons = Choice()
|
||||||
embed = discord.Embed(description="What is your bet?", color=0xBEBEFE)
|
embed = discord.Embed(
|
||||||
|
title="Coinflip",
|
||||||
|
description="What is your bet?",
|
||||||
|
color=0x7289DA
|
||||||
|
)
|
||||||
|
embed.set_author(name="Fun", icon_url="https://yes.nighty.works/raw/eW5lLm.webp")
|
||||||
message = await context.send(embed=embed, view=buttons)
|
message = await context.send(embed=embed, view=buttons)
|
||||||
await buttons.wait()
|
await buttons.wait()
|
||||||
result = random.choice(["heads", "tails"])
|
result = random.choice(["heads", "tails"])
|
||||||
if buttons.value == result:
|
if buttons.value == result:
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
|
title="Coinflip",
|
||||||
description=f"Correct! You guessed `{buttons.value}` and I flipped the coin to `{result}`.",
|
description=f"Correct! You guessed `{buttons.value}` and I flipped the coin to `{result}`.",
|
||||||
color=0xBEBEFE,
|
color=0x00FF00,
|
||||||
)
|
)
|
||||||
|
embed.set_author(name="Fun", icon_url="https://yes.nighty.works/raw/eW5lLm.webp")
|
||||||
else:
|
else:
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
|
title="Coinflip",
|
||||||
description=f"Woops! You guessed `{buttons.value}` and I flipped the coin to `{result}`, better luck next time!",
|
description=f"Woops! You guessed `{buttons.value}` and I flipped the coin to `{result}`, better luck next time!",
|
||||||
color=0xE02B2B,
|
color=0xE02B2B,
|
||||||
)
|
)
|
||||||
|
embed.set_author(name="Fun", icon_url="https://yes.nighty.works/raw/eW5lLm.webp")
|
||||||
await message.edit(embed=embed, view=None, content=None)
|
await message.edit(embed=embed, view=None, content=None)
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot) -> None:
|
async def setup(bot) -> None:
|
||||||
await bot.add_cog(CoinFlip(bot))
|
await bot.add_cog(CoinFlip(bot))
|
||||||
@@ -80,9 +80,9 @@ class Help(commands.Cog, name="help"):
|
|||||||
if category is None:
|
if category is None:
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Help",
|
title="Help",
|
||||||
color=0x808080
|
color=0x7289DA
|
||||||
)
|
)
|
||||||
embed.set_author(name="Help", icon_url="https://yes.nighty.works/raw/HP69uM.png")
|
embed.set_author(name="Help", icon_url="https://yes.nighty.works/raw/T9mnBO.png")
|
||||||
|
|
||||||
available_categories = set()
|
available_categories = set()
|
||||||
for cog_name in self.bot.cogs:
|
for cog_name in self.bot.cogs:
|
||||||
@@ -115,7 +115,7 @@ class Help(commands.Cog, name="help"):
|
|||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Error",
|
title="Error",
|
||||||
description=f"Category '{category}' not found. Use `/help` to see available categories.",
|
description=f"Category '{category}' not found. Use `/help` to see available categories.",
|
||||||
color=0x808080
|
color=0x7289DA
|
||||||
)
|
)
|
||||||
if context.interaction:
|
if context.interaction:
|
||||||
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
@@ -127,7 +127,7 @@ class Help(commands.Cog, name="help"):
|
|||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Error",
|
title="Error",
|
||||||
description="You don't have permission to view owner commands.",
|
description="You don't have permission to view owner commands.",
|
||||||
color=0x808080
|
color=0x7289DA
|
||||||
)
|
)
|
||||||
if context.interaction:
|
if context.interaction:
|
||||||
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
@@ -149,7 +149,7 @@ class Help(commands.Cog, name="help"):
|
|||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Error",
|
title="Error",
|
||||||
description=f"No commands found in category '{category}'.",
|
description=f"No commands found in category '{category}'.",
|
||||||
color=0x808080
|
color=0x7289DA
|
||||||
)
|
)
|
||||||
if context.interaction:
|
if context.interaction:
|
||||||
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
@@ -159,9 +159,9 @@ class Help(commands.Cog, name="help"):
|
|||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title=f"/help » {category.lower()}",
|
title=f"/help » {category.lower()}",
|
||||||
color=0x808080
|
color=0x7289DA
|
||||||
)
|
)
|
||||||
embed.set_author(name="Help", icon_url="https://yes.nighty.works/raw/HP69uM.png")
|
embed.set_author(name="Help", icon_url="https://yes.nighty.works/raw/T9mnBO.png")
|
||||||
data = []
|
data = []
|
||||||
for command_name, description in sorted(commands_in_category):
|
for command_name, description in sorted(commands_in_category):
|
||||||
data.append(f"**/{command_name}** » {description}")
|
data.append(f"**/{command_name}** » {description}")
|
||||||
|
|||||||
Reference in New Issue
Block a user