Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tookender committed Sep 13, 2023
1 parent c9b4303 commit 38660cd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 77 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
config.toml
__pycache__/
.vscode
env
env
venv
85 changes: 9 additions & 76 deletions extensions/world/faq.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import discord
from discord.ext import commands
from discord.ext.commands import command
from discord.ui import button

from bot import Korii
from utils import Embed, Interaction
Expand Down Expand Up @@ -49,68 +48,8 @@ class FAQView(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)

@button(
emoji="💻",
label="Modifications",
style=discord.ButtonStyle.blurple,
custom_id="world:modifications"
)
async def modifications(self, interaction: Interaction, button: discord.ui.Button):
addons = """
**Anti Combat Log:** Prevent people from logging while in combat.
**Auction House:** Using the auction house you can sell or buy items using our in-game currency. /ah
**Concrete Mixer:** Put concrete powder into a cauldron to get concrete.
**Levelled Mobs:** All mobs spawn with a different level. Higher level = higher damage, drops, etc.
**Auto Pickup:** Automatically pick up items.
**Skills:** Skills to earn stat buffs, unlock and level up abilities, and more. /skills
**Villager Death Messages:** Be notified about when a villager dies.
**Custom Nether Portals:** Make nether portals no matter the shape and size.
**No Enderman Grief:** Endermen can no longer pick up blocks.
**Mltiplayer Sleep:** Only one person has to sleep to skip the night.
**Armored Elytras:** Drop a chestplate and an elytra on an anvil to combine the two.
**Durability Ping:** Get notified when an item reaches low durability.
**Fast Leaf Decay:** Leaves decay faster.
**More Mob Heads:** A small chance to get a mob head from all mobs.
**Mine Treasure:** Get random treasure chests from mining depending on the biome.
**Timber:** Break trees, faster.
**Graves:** If you die, a grave will spawn, right click it to get all your items back.
"""

modifications = [
"Villagers follow emerald blocks.",
"You can silk touch spawners.",
"Bows with infinity + mending.",
"Right click to edit signs.",
"Ender chests have 6 rows.",
"Use colors in signs.",
"Better mending.",
"Flying squids.",
]

embed = Embed(
title="List of modifications",
description=addons,
)

embed.add_field(
name="Modifications",
value="\n".join([f"- {modification}" for modification in modifications]),
inline=False,
)

return await interaction.response.send_message(
embed=embed,
ephemeral=True,
)

@button(
emoji="⚡",
label="Levelling Rewards",
style=discord.ButtonStyle.blurple,
custom_id="world:levelling_rewards",
)
async def levelling_rewards(self, interaction: Interaction, button: discord.ui.Button):
@discord.ui.button(emoji="⚡", label="Levelling Rewards", style=discord.ButtonStyle.blurple, custom_id="world:levelling_rewards")
async def levelling_rewards(self, interaction: Interaction, _):
rewards = [
"<@&1069284713056977006> Custom color roles",
"<@&1069284714311057478> Host your own events",
Expand All @@ -128,12 +67,13 @@ async def levelling_rewards(self, interaction: Interaction, button: discord.ui.B

return await interaction.response.send_message(embed=embed, ephemeral=True)

@button(emoji="🎫", label="Create Ticket", style=discord.ButtonStyle.green, custom_id="world:ticket")
async def create_ticket(self, interaction: Interaction, button: discord.ui.Button):
@discord.ui.button(emoji="🎫", label="Create Ticket", style=discord.ButtonStyle.green, custom_id="world:ticket")
async def create_ticket(self, interaction: Interaction, _):
return await interaction.response.send_message(
"This feature is coming soon, for the time being, you can contact the server owner.",
ephemeral=True,
)

# return await interaction.response.send_modal(TicketModal())


Expand Down Expand Up @@ -166,7 +106,7 @@ async def faq(self, ctx: commands.Context):

embed.add_field(
name="2️⃣ How do I get reaction roles?",
value="You can get reaction roles at <#1069276775055638548> by clicking the **🎭 Reaction Roles** button.",
value="You can get reaction roles at <id:customize>.",
inline=False,
)

Expand All @@ -184,26 +124,19 @@ async def faq(self, ctx: commands.Context):
)

embed.add_field(
name="5️⃣ What modifications are on the Korino SMP?",
value="Click the **💻 Modifications** button below to view them.",
inline=False,
title=False,
)

embed.add_field(
name="6️⃣ Are there any levelling rewards?",
name="5️⃣ Are there any levelling rewards?",
value="Yes, for more info click the **⚡ Levelling Rewards** button below.",
inline=False,
)

embed.add_field(
name="7️⃣ Why are some buttons blue and some green?",
name="6️⃣ Why are some buttons blue and some green?",
value="Blue buttons not interactive and send text/info. Green buttons are interactive buttons which you can interact with after pressing.",
inline=False,
)

embed.add_field(
name="8️⃣ My question was not answered here/I need help.",
name="7️⃣ My question was not answered here/I need help.",
value="Create a ticket by clicking the **🎫 Create Ticket** button below.",
inline=False,
)
Expand Down
23 changes: 23 additions & 0 deletions extensions/world/join.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import contextlib
import random

import discord
from discord.ext import commands

from utils import Embed, Korii


class JoinCog(commands.Cog):
def __init__(self, bot: Korii):
self.bot = bot

@commands.Cog.listener("on_member_join")
async def ping_new_member(self, member: discord.Member):
if member.guild.id != 1059116571215278121:
return

channel = self.bot.get_channel(1069276775055638548)

assert isinstance(channel, discord.TextChannel)

return await channel.send(member.mention, allowed_mentions=discord.AllowedMentions.all())

0 comments on commit 38660cd

Please sign in to comment.