Compare commits
2
Commits
236b85c7ec
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
149eda7915 | ||
|
|
b2559ae507 |
No files matched your search
+2
-1
@@ -1,4 +1,5 @@
|
||||
.env
|
||||
ceme.db
|
||||
|
||||
*.pyc
|
||||
*.pyd
|
||||
poetry.lock
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; url=https://discord.com/oauth2/authorize?client_id=1352427244257017877" />
|
||||
</head>
|
||||
</html>
|
||||
@@ -1,3 +1,7 @@
|
||||
# cementium
|
||||
|
||||
stupid bot
|
||||
stupid sample bot for my discord projects going forward
|
||||
|
||||
aio = libuv
|
||||
db = sqlite
|
||||
code style = black
|
||||
@@ -1,55 +1,70 @@
|
||||
import random
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import app_commands
|
||||
from dotenv import load_dotenv
|
||||
import random
|
||||
import os
|
||||
|
||||
if sys.platform == "Linux":
|
||||
import uvloop
|
||||
else:
|
||||
import winloop
|
||||
|
||||
load_dotenv()
|
||||
token = os.getenv('TOKEN')
|
||||
TOKEN = os.getenv("TOKEN")
|
||||
|
||||
description = '''cement'''
|
||||
description = """cement"""
|
||||
|
||||
intents = discord.Intents.all()
|
||||
intents.members = True
|
||||
intents.message_content = True
|
||||
|
||||
|
||||
bot = commands.Bot(command_prefix='?',
|
||||
description=description,
|
||||
intents=intents)
|
||||
bot = commands.Bot(command_prefix="?", description=description, intents=intents)
|
||||
|
||||
|
||||
libs = ['jishaku',]
|
||||
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.')
|
||||
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"[^] Sync'd application commands to {len(bot.guilds)} servers")
|
||||
|
||||
print(f'[*] Logged in as {bot.user} (ID: {bot.user.id})')
|
||||
print('------')
|
||||
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)}')
|
||||
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')
|
||||
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)
|
||||
|
||||
if sys.platform == "Linux":
|
||||
uvloop.install()
|
||||
else:
|
||||
winloop.install()
|
||||
|
||||
bot.run(TOKEN)
|
||||
+7
-3
@@ -5,19 +5,23 @@ description = "huge cement"
|
||||
authors = [
|
||||
{name = "b0ner",email = "ph0sgene@pm.me"}
|
||||
]
|
||||
|
||||
readme = "README.md"
|
||||
license = "LICENSE"
|
||||
|
||||
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)"
|
||||
"python-dotenv (>=1.0.1,<2.0.0)",
|
||||
"winloop (>=0.1.8,<0.2.0) ; sys_platform == \"win32\"",
|
||||
"uvloop (>=0.21.0,<0.22.0) ; sys_platform == \"linux\"",
|
||||
]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
package-mode = false
|
||||
Reference in new issue
Block a user