-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
152 lines (109 loc) · 5.44 KB
/
main.py
File metadata and controls
152 lines (109 loc) · 5.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import discord
from discord import app_commands
from discord.ext import commands
from dotenv import load_dotenv
import random
import os
from database import *
load_dotenv()
TOKEN = os.getenv("TOKEN")
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix='+', intents=intents)
textos = (
"🌙| Use meus novos comandos! /minerar!"
)
@bot.event
async def on_ready():
print("--- LUA BOT :P ---")
print(f"LuaBot Online! - {bot.user.name} ({bot.user.id})")
print("-------------------")
await bot.change_presence(
activity=discord.CustomActivity(
textos
)
)
try:
synced = await bot.tree.sync()
print(f"Sincronizados {len(synced)} comandos..")
except Exception as e:
print(f"Erro ao sincronizar comandos: {e}")
print(f'Bot conectado como {bot.user}')
@bot.tree.command(name="ping", description="Veja o ping do bot")
async def ping(interaction: discord.Interaction):
latency = round(bot.latency * 1000)
await interaction.response.send_message(f"AU AU!! \nLatência: {latency}ms")
@bot.tree.command(name="morder", description="Dá uma mordida carinhosa em alguém")
async def morder(interaction: discord.Interaction, user: discord.Member):
await interaction.response.send_message(
f"🐾 A Lua correu e deu uma mordidinha carinhosa em {user.mention}!!"
)
@bot.tree.command(name="chinelos", description="Lua mostra um chinelo destruído")
async def chinelos(interaction: discord.Interaction):
embed = discord.Embed(title="O Chinelo virou pó!")
embed.set_image(url="https://i.postimg.cc/fL8khMgX/Opera-Instant-neo-2025-09-16-194923-www-canva-com.png")
await interaction.response.send_message(embed=embed)
@bot.tree.command(name="carinho", description="Faça carinho na Lua!!")
async def carinho(interaction: discord.Interaction):
await interaction.response.send_message(
"💖 A Lua aceitou seu carinho!! (mas cuidado, ela ainda pode te morder hehe:P)"
)
@bot.tree.command(name="latir", description="Lua manda latidos para você")
async def latir(interaction: discord.Interaction):
await interaction.response.send_message("AU AU AUUUUUUUUUUUUUUUUUUUUUUUUUUU!")
@bot.tree.command(name="brinquedo", description="Lua mostra um brinquedo para você :3")
async def brinquedo(interaction: discord.Interaction):
embed = discord.Embed(title="Aqui ó, um brinquedo pra você!")
embed.set_image(url="https://imgur.com/a/cNUnoSo")
await interaction.response.send_message(embed=embed)
@bot.tree.command(name="ajuda", description="As vezes precisamos de Ajuda :3")
async def ajuda(interaction: discord.Interaction):
await interaction.response.send_message("Olá! meu prefixo nesse servidor é "/", :3")
@bot.tree.command(name="saldo", description="Verifique quanto você tem de MoonCoins!")
async def saldo(interaction: discord.Interaction):
moedas = await checar_saldo(interaction.user)
await interaction.response.send_message(
f"Você possui 🪙 **{moedas}** MoonCoins!"
)
@bot.tree.command(name="daily", description="Pegue sua recompensa")
@app_commands.checks.cooldown(1, 86400, key=lambda i: (i.guild_id, i.user.id))
async def daily(interaction: discord.Interaction):
valor = random.randint(40,150)
await alterar_saldo(interaction.user,valor)
await interaction.response.send_message(f"<:gatodojoia:1419360636084682812> | Au Au {interaction.user.mention}! Você ganhou {valor} MoonCoins!")
@daily.error
async def daily_error(interaction: discord.Interaction, error: app_commands.AppCommandError):
if isinstance(error,app_commands.CommandOnCooldown):
await interaction.response.send_message(f"❌ | **Você já recebeu sua recompensa diária de MoonCoins hoje!** Você poderá pegar novamente em {round(error.cooldown.get_retry_after()/3600,2)} horas!", ephemeral=True)
else:
raise(error)
# Tive a Ideia quando tava vendo o Koxik Bot
@bot.tree.command(name="minerar", description="[Minecraft] Minere Minérios no Discord!")
async def minerar(interaction: discord.Interaction):
minerios = ["Pedra", "Carvão", "Cobre", "Ferro", "Ouro", "Diamante"]
resultado = random.choices(minerios)
embed = discord.Embed(
title="⛏️ Mineração",
description=f"{interaction.user.mention} foi pras profundezas e encontrou:",
color=discord.Color.blue()
)
embed.add_field(name="Minério Coletado", value=f"Minério: ⛏️ {resultado}")
await interaction.response.send_message(embed=embed)
@bot.tree.command(name="coinflip", description="Faça um Cara ou Coroa no Discord!")
async def coinflip(interaction: discord.Interaction):
caraoucoroa = ["Cara", "Coroa"]
resultado = random.choices(caraoucoroa)
await interaction.response.send_message(f"🪙 {resultado}!")
bot.tree.command(name="minecraft_skin", description="Veja a skin de um jogador de Minecraft")
@app_commands.describe(player="O nome (nickname) do jogador")
async def skin(interaction: discord.Interaction, player: str):
# Render "body" mostra o corpo inteiro do personagem
skin_url = f"https://crafatar.com/renders/body/{player}?overlay"
embed = discord.Embed(
title=f"Skin de {player}",
color=discord.Color.blue()
)
embed.set_image(url=skin_url)
embed.set_footer(text="API fornecida por Crafatar")
await interaction.response.send_message(embed=embed)
bot.run(TOKEN)