diff --git a/assets/dp.png b/assets/dp.png index 36063dc..2cfd200 100644 Binary files a/assets/dp.png and b/assets/dp.png differ diff --git a/assets/rp.png b/assets/rp.png index 019758d..9d36835 100644 Binary files a/assets/rp.png and b/assets/rp.png differ diff --git a/cogs/ckomakenlevel.py b/cogs/ckomakenlevel.py index 80108cc..1b54593 100644 --- a/cogs/ckomakenlevel.py +++ b/cogs/ckomakenlevel.py @@ -107,7 +107,7 @@ async def on_message(self, message: discord.Message): end = 125 add = math.floor(userdb.level / 10) if userdb.level / 10 < 10 else 10 - exp_orb_add = math.floor(userdb.level / 10) if userdb.level / 100 < 30 else 30 + exp_orb_add = math.floor(userdb.level / 100) if userdb.level / 100 < 30 else 30 exp_per_message = random.randint(start + add, end + add) if 500 <= random.randint(1, 1000) <= 500 + exp_orb_add: exp_per_message = 500 diff --git a/cogs/ticket_tool.py b/cogs/ticket_tool.py new file mode 100644 index 0000000..78110ea --- /dev/null +++ b/cogs/ticket_tool.py @@ -0,0 +1,94 @@ +import discord +from discord import ButtonStyle, Interaction, app_commands +from discord.ext import commands +from discord.ui import Button, View, button +from datetime import datetime + +from config.config import config + + +class ResumeButton(View): + def __init__(self): + super().__init__(timeout=None) + + @button(label="【運営用】問い合わせを再開", style=ButtonStyle.green, custom_id="resume") + async def resumebutton(self, interaction: Interaction, button: Button): + await interaction.channel.edit(locked=False) + await interaction.message.delete() + await interaction.response.send_message("問い合わせを再開しました") + + +class FinalFinishButton(View): + def __init__(self): + super().__init__(timeout=None) + + @button(label="はい(終了する)", style=ButtonStyle.green, custom_id="final-finish-yes") + async def finalfinishbutton_yes(self, interaction: Interaction, button: Button): + try: + resumebutton = ResumeButton() + await interaction.response.send_message("問い合わせを終了しました", view=resumebutton) + except Exception as e: + print(e) + await interaction.message.delete() + await interaction.channel.edit(locked=True) + + @button(label="いいえ(終了しない)", style=ButtonStyle.red, custom_id="final-finish-no") + async def finalfinishbutton_no(self, interaction: Interaction, button: Button): + await interaction.message.delete() + + +class FinidhButton(View): + def __init__(self): + super().__init__(timeout=None) + + @button(label="問い合わせを終了する", style=ButtonStyle.red, custom_id="finish") + async def finishbutton(self, interaction: Interaction, button: Button): + finalfinishbutton = FinalFinishButton() + await interaction.response.send_message("本当に問い合わせを終了してもいいですか?", view=finalfinishbutton) + + +class ContactButton(View): + def __init__(self): + super().__init__(timeout=None) + + @button(label="問い合わせを開始する", style=ButtonStyle.success, custom_id="contact") + async def contactbutton(self, interaction: Interaction, button: Button): + thread_title = f"{interaction.user.display_name}-{datetime.now().strftime("%Y%m%d%H%M%S")}" + thread = await interaction.channel.create_thread(name=thread_title, invitable=False, auto_archive_duration=4320) + contact_log = await interaction.guild.fetch_channel(config.channels.cmdbot_log) + thread_embed = discord.Embed( + title="問い合わせが開始されました。", + description="問い合わせ内容を記入してお待ちください\n運営が気づき次第、対応いたします。" + ) + thread_embed.set_footer(text="間違えて作成した場合は下のボタンを押してください") + admin_role = f"\n<@&{config.roles.administrater}> 対応お願いします" + finidhbutton = FinidhButton() + await contact_log.send(f"問い合わせが開始されました{thread.jump_url}") + await thread.send(f"問い合わせ者:{interaction.user.mention}{admin_role}", embed=thread_embed, view=finidhbutton) + await interaction.response.send_message(f"{thread.jump_url}を作成しました。そちらへ移動願います", ephemeral=True) + + +class TicketTool(commands.Cog): + def __init__(self, bot: commands.Bot): + self.bot = bot + + @app_commands.command(name="contact", description="問い合わせ開始メッセージを送信") + async def contact(self, interaction: discord.Interaction): + contact_embed = discord.Embed( + title="お問い合わせ", + description="鯖主へ個別に問い合わせしたい場合は、下の緑のボタンを押してください。", + color=0x30ff00 + ) + try: + button = ContactButton() + await interaction.channel.send(embed=contact_embed, view=button, silent=True) + except Exception as e: + print(e) + + +async def setup(bot: commands.Bot): + await bot.add_cog(TicketTool(bot)) + bot.add_view(ResumeButton()) + bot.add_view(FinalFinishButton()) + bot.add_view(FinidhButton()) + bot.add_view(ContactButton()) diff --git a/data/json_ore_gacha.json b/data/json_ore_gacha.json index b74b5e0..22b3948 100644 --- a/data/json_ore_gacha.json +++ b/data/json_ore_gacha.json @@ -184,7 +184,7 @@ }, { "seed_start":81084, - "japanese":"金インゴットブロック", + "japanese":"金ブロック", "filename":"Block_of_Gold", "level":0, "xp":1350, diff --git a/data/pack_versions.json b/data/pack_versions.json index adddf21..d927444 100644 --- a/data/pack_versions.json +++ b/data/pack_versions.json @@ -132,11 +132,23 @@ "dp_full": "---", "rp_full": "---" }, - "1.21.9": { + "1.21.9-1.21.10": { "dp": 88.0, "rp": 69.0, "dp_full": "---", "rp_full": "---" + }, + "1.21.11": { + "dp": 94.1, + "rp": 75.0, + "dp_full": "---", + "rp_full": "---" + }, + "26.1.0-26.1.2": { + "dp": 101.1, + "rp": 84.0, + "dp_full": "---", + "rp_full": "---" } } }