From cc7dbe2770475df1319dc3faa2da25359be58f26 Mon Sep 17 00:00:00 2001 From: b0n Date: Sun, 30 Mar 2025 11:50:23 -0700 Subject: [PATCH] Initial commir --- .gitignore | 1 + bot.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ lib/db.py | 9 +++++++++ lib/static.py | 27 +++++++++++++++++++++++++ pyproject.toml | 23 +++++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 .gitignore create mode 100644 bot.py create mode 100644 lib/db.py create mode 100644 lib/static.py create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/bot.py b/bot.py new file mode 100644 index 0000000..ffcc1c1 --- /dev/null +++ b/bot.py @@ -0,0 +1,55 @@ +import discord +from discord.ext import commands +from discord import app_commands +from dotenv import load_dotenv +import random +import os + + +load_dotenv() +token = os.getenv('TOKEN') + +description = '''cement''' + +intents = discord.Intents.all() +intents.members = True +intents.message_content = True + + +bot = commands.Bot(command_prefix='?', + description=description, + intents=intents) + + +libs = ['jishaku',] + +@bot.event +async def on_ready(): + + for lib in libs: + await bot.load_extension(lib) + print(f'\n[^] Loaded {len(libs)} extensions loaded successfully.') + + for guild in bot.guilds: + await bot.tree.sync(guild=discord.Object(id=guild.id)) + print(f'[^] Sync\'d application commands to {len(bot.guilds)} servers') + + print(f'[*] Logged in as {bot.user} (ID: {bot.user.id})') + print('------') + + +@bot.command() +async def joined(ctx, member: discord.Member): + """Says when a member joined.""" + await ctx.send(f'{member.name} joined {discord.utils.format_dt(member.joined_at)}') + +@bot.group() +async def cool(ctx): + if ctx.invoked_subcommand is None: + await ctx.send(f'No, {ctx.subcommand_passed} is not cool') + +@bot.hybrid_command(name="first_slash") +async def first_slash(ctx): + await ctx.send("You executed the slash command!") + +bot.run(token) \ No newline at end of file diff --git a/lib/db.py b/lib/db.py new file mode 100644 index 0000000..ac1f74d --- /dev/null +++ b/lib/db.py @@ -0,0 +1,9 @@ +from discord.ext import commands +import aiosqlite + +@commands.command() +async def hello(ctx): + await ctx.send(f'Hello {ctx.author.display_name}.') + +async def setup(bot): + bot.add_command(hello) \ No newline at end of file diff --git a/lib/static.py b/lib/static.py new file mode 100644 index 0000000..0698fb4 --- /dev/null +++ b/lib/static.py @@ -0,0 +1,27 @@ +import random + +class Cement: + def __init__(self, rank): + + self.ranks = { + 'unq' : 'Unique', + 'ssr' : 'Super Super Rare', + 'exo' : 'Exotic', + 'unk' : 'Uncommon', + 'n': 'Normal', + } + + self.dice_ranges = { + 'unq' : [8, 12], + 'ssr' : [4, 10], + 'exo' : [4, 8], + 'unk' : [2, 6], + 'n': [1, 4] + } + self.rank = rank + + + +test = Cement('ssr') + +print(test.rank) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cd4eb59 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +[project] +name = "cement" +version = "0.1.0" +description = "huge cement" +authors = [ + {name = "b0ner",email = "ph0sgene@pm.me"} +] +readme = "README.md" + +requires-python = ">=3.11" +dependencies = [ + "discord (>=2.3.2,<3.0.0)", + "aiosqlite (>=0.21.0,<0.22.0)", + "jishaku (>=2.6.0,<3.0.0)", + "python-dotenv (>=1.0.1,<2.0.0)" +] + +[tool.poetry.dependencies] + +[build-system] +requires = ["poetry-core>=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api" +