mass send added

This commit is contained in:
ggodot 2025-03-10 00:09:35 +01:00
parent 49f4039844
commit d953280373

View File

@ -17,7 +17,7 @@ async def on_ready():
@bot.slash_command(guild_ids=g_ids, name = "ahoj", description="Je slušností pozdravit") @bot.slash_command(guild_ids=g_ids, name = "ahoj", description="Je slušností pozdravit")
async def summary(ctx): async def ahoj(ctx):
await ctx.channel.trigger_typing() # that bot is typing await ctx.channel.trigger_typing() # that bot is typing
try: try:
@ -84,15 +84,6 @@ async def shame(ctx, hranice: Option(int, description = "Where is the line", req
await ctx.channel.trigger_typing() # that bot is typing await ctx.channel.trigger_typing() # that bot is typing
role = await check_role(ctx, ctx.author)
if role == False:
try:
await ctx.respond("Já nevěřit tvým šprímům, ty více ukázati musíš.")
except:
await ctx.send("Já nevěřit tvým šprímům, ty více ukázati musíš.")
elif role == True:
try: try:
await ctx.respond("Rado se, pracuju na tom.") await ctx.respond("Rado se, pracuju na tom.")
except: except:
@ -128,6 +119,25 @@ async def shame(ctx, hranice: Option(int, description = "Where is the line", req
await ctx.author.send(embed = em) await ctx.author.send(embed = em)
@bot.slash_command(guild_ids=g_ids, name="laska_k_svetu", descritpion="Auto send message to users in shame")
async def laska_k_svetu(ctx, message: Option(str, descritpion = "What to send", required = True), hranice: Option(int, description = "Where is the line", required = False) = -1):
await ctx.channel.trigger_typing() # that bot is typing
try:
await ctx.respond("Rado se, pracuju na tom.")
except:
await ctx.send("Rado se, pracuju na tom.")
users = await get_bank_data()
for user in users:
if users[user]["wallet"] <= hranice:
user_obj = await bot.fetch_user(int(user))
await user_obj.send(f"{message}. Protože máš {users[user]["wallet"]} bodiku.")
@bot.slash_command(guild_ids=g_ids, name="payout", descritpion="Pays user given amount") @bot.slash_command(guild_ids=g_ids, name="payout", descritpion="Pays user given amount")
async def payout(ctx, komu: Option(str, description = "Komu to sebrat?", required = True), kolik: Option(int, description = "Kolik bodicku sebrat", required = True)): async def payout(ctx, komu: Option(str, description = "Komu to sebrat?", required = True), kolik: Option(int, description = "Kolik bodicku sebrat", required = True)):
await ctx.channel.trigger_typing() # that bot is typing await ctx.channel.trigger_typing() # that bot is typing
@ -140,14 +150,6 @@ async def payout(ctx, komu: Option(str, description = "Komu to sebrat?", require
for mem in komu.split(): for mem in komu.split():
mem = mem.strip("<>@") mem = mem.strip("<>@")
role = await check_role(ctx, ctx.author)
if role == False:
try:
await ctx.respond("Větší snahy ze strany tvé nastati budou než já podlehnu.")
except:
await ctx.send("Větší snahy ze strany tvé nastati budou než já podlehnu.")
break
member = await bot.fetch_user(int(mem)) member = await bot.fetch_user(int(mem))
await open_account(mem) await open_account(mem)
@ -155,7 +157,7 @@ async def payout(ctx, komu: Option(str, description = "Komu to sebrat?", require
await update_bank(member,kolik) await update_bank(member,kolik)
await ctx.send(f"{member.name} dostal vyplaceno {kolik} bodíčků!") await ctx.send(f"<@{mem}> dostal vyplaceno {kolik} bodíčků!")
@bot.slash_command(guild_ids=g_ids, name = "cut", description = "Takes bodičky from users") @bot.slash_command(guild_ids=g_ids, name = "cut", description = "Takes bodičky from users")
async def cut(ctx, komu: Option(str, description = "Komu mam sebrat bodiky?", required = True),kolik: Option(int, descritpion = "Kolik mam sebrat bodičku?", required = True)): async def cut(ctx, komu: Option(str, description = "Komu mam sebrat bodiky?", required = True),kolik: Option(int, descritpion = "Kolik mam sebrat bodičku?", required = True)):
@ -169,14 +171,6 @@ async def cut(ctx, komu: Option(str, description = "Komu mam sebrat bodiky?", re
for mem in komu.split(): for mem in komu.split():
mem = mem.strip("<>@") mem = mem.strip("<>@")
role = await check_role(ctx, ctx.author)
if role == False:
try:
await ctx.respond("Větší snahy ze strany tvé nastati budou než já podlehnu.")
except:
await ctx.send("Větší snahy ze strany tvé nastati budou než já podlehnu.")
break
member = await bot.fetch_user(int(mem)) member = await bot.fetch_user(int(mem))
@ -184,7 +178,7 @@ async def cut(ctx, komu: Option(str, description = "Komu mam sebrat bodiky?", re
await update_bank(member,int(kolik)*-1) await update_bank(member,int(kolik)*-1)
await ctx.send(f"{member.name} dostal zabaveno {kolik} bodíčků!") await ctx.send(f"<@{mem}> dostal zabaveno {kolik} bodíčků!")
async def open_account(id): async def open_account(id):