Compare commits

..

No commits in common. "6f54322a3e05b2aaf5b484f6884ed983fa56997e" and "73ce1f71e79478ab0ce3a6d86f79cbf8812f450e" have entirely different histories.

7 changed files with 34 additions and 76 deletions

2
.gitignore vendored
View File

@ -1,4 +1,2 @@
.env .env
launch.sh launch.sh
src/bot/__pycache__
src/commands/__pycache__

4
.vscode/tasks.json vendored
View File

@ -2,9 +2,9 @@
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "Start Bot", "label": "Run Project",
"type": "shell", "type": "shell",
"command": "./launch.sh", "command": "launch.sh",
"problemMatcher": [], "problemMatcher": [],
"group": { "group": {
"kind": "build", "kind": "build",

View File

@ -1,7 +0,0 @@
"""
Bot package - Discord bot manager
"""
__all__ = ["setup_bot", "start_bot"]
from .bot import *

View File

@ -1,34 +0,0 @@
import discord
from discord.ext import commands
from dotenv import load_dotenv
from os import getenv
from commands.discord_commands import *
def setup_bot() -> commands.Bot:
print("Configuring bot...")
load_dotenv()
bot = commands.Bot(command_prefix="/", intents=discord.Intents.all())
@bot.event
async def on_ready():
try:
synced = await bot.tree.sync()
print(f"Successfully synced {len(synced)} commands")
except Exception as e:
print(e)
print("Bot ready !")
setup_commands(bot)
return bot
def start_bot(bot: commands.Bot) -> None:
print("Starting bot...")
token = getenv("DISCORD_TOKEN")
if token:
bot.run(token)
else:
print("token error")

View File

@ -1,7 +0,0 @@
"""
Commands package - Discord commands manager
"""
__all__ = ["setup_commands"]
from .discord_commands import *

View File

@ -1,7 +0,0 @@
import discord
from discord.ext import commands
def setup_commands(bot: commands.Bot) -> None:
@bot.tree.command(name="trustme", description="Come on, shake your body baby.")
async def trustme(interaction: discord.Interaction):
await interaction.response.send_message("https://matias.ma/nsfw/")

View File

@ -1,37 +1,52 @@
from dis import disco
import discord import discord
from bot import * import os
from discord.ext import commands
from dotenv import load_dotenv
bot = setup_bot() load_dotenv()
print("Launching DeltaBot...")
#bot = discord.Client(intents=discord.Intents.all()) #bot = discord.Client(intents=discord.Intents.all())
bot = commands.Bot(command_prefix="/", intents=discord.Intents.all())
#bot_channel = bot.get_channel(1424301304225857667) #bot_channel = bot.get_channel(1424301304225857667)
@bot.event
async def on_ready():
try:
synced = await bot.tree.sync()
print(f"Successfully synced {len(synced)} commands")
except Exception as e:
print(e)
print("Bot ready !")
@bot.event @bot.event
async def on_message(message: discord.Message): async def on_message(message: discord.Message):
if message.author.bot: if message.author.bot:
return return
words = message.content.lower().split() message_content = message.content.lower().__str__()
channel = message.channel channel = message.channel
if "bonjour" in words: if message_content.__contains__("bonjour"):
await channel.send("bien dormii ?? (˶ᵔᵕᵔ˶)₊˚⊹♡") await channel.send("bien dormii ?? (˶ᵔᵕᵔ˶)₊˚⊹♡")
if any(mot in words for mot in ["oui", "ui", "ouai", "ouaip", "yes", "yep"]) and not message.content.__contains__("?"): if message_content.__contains__("ui"):
await channel.send("trow bienn~ (˶ᵔᵕᵔ˶) 𝟹") await channel.send("trow bienn~ (˶ᵔᵕᵔ˶) 𝟹")
if "<@1169377208893194275>" in words: if message_content.__contains__("<@1169377208893194275>"):
await channel.send("c'est mon mimi nathan qu'on tag ?? ⸜(。˃ ᵕ ˂)⸝♡") await channel.send("c'est mon mimi nathan qu'on tag ?? ⸜(。˃ ᵕ ˂)⸝♡")
await channel.send("UwU")
if "c" in words: @bot.tree.command(name="trustme", description="Come on, shake your body baby.")
await channel.send("le C c'est trow bienn~ (⸝⸝>ᴗ•⸝⸝)") async def trustme(interaction: discord.Interaction):
await interaction.response.send_message("https://matias.ma/nsfw/")
if "c++" in words: token = os.getenv("DISCORD_TOKEN")
await channel.send("le C++ c'est trow coool ╰(°ㅂ°)╯") if token:
bot.run(token)
def main(): else:
start_bot(bot) print("token error")
if __name__ == "__main__":
main()