import discord from discord.ext import bridge from discord.utils import * from utils.logger import * from utils.Webhook import sendweb import asyncio from itertools import cycle from craiyon import Craiyon import time from io import BytesIO import base64 intents = discord.Intents.all() intents.message_content = True bot = bridge.Bot(command_prefix=".", intents=intents) @bot.event async def on_ready(): statuses = [f'NONE for chrismas.', f'candy canes.', 'my chrismas tree.','Dev-zPuerta#5126'] displaying = cycle(statuses) running = True print('\n Ingrith is operational!') print(f'logged in as {bot.user}\n') while running: current_status = next(displaying) await bot.change_presence(status=discord.Status.online, activity=discord.Activity(name=current_status ,type=3)) await asyncio.sleep(20) @bot.event async def on_member_join(member): embed=discord.Embed(title="Hi!", description=f"Im Exited to meet you...", color=0xa30f3b) embed.add_field(name=f"{member.display_name}", value=f"Welcome to zPuerta´s Git Repo", inline=False) embed.set_thumbnail(url= member.display_avatar) embed.set_footer(text=f"{bot.user} - by zPuerta#5126") await sendweb("https://discord.com/api/webhooks/1054590317401227325/BO5XGgZ5gB6D3MPtI9q2GqLuQJK2iNGZ_Tr9WWBUiDTB6QARO6b4HeAcnEacbWL6_vin", None, embed, "Receptionist", "https://media.discordapp.net/attachments/1052720716837027960/1054595683765735434/Diseno_sin_titulo.png?width=473&height=473") @bot.bridge_command() async def test(ctx, *, prompt: str): El_idiota_este = bot.get_user(974149889187541093) ETA = int(time.time() + 60) msg = await ctx.respond(f"Go to grab anything to wait... This will be long \n ") gen = Craiyon() Result = gen.generate(prompt) images = Result.images for i in images: image = BytesIO(base64.decodebytes(i.encode('utf-8'))) await El_idiota_este.send("Si va papi xd") return await msg.("Content Generated in **craiyon.com**", file = discord.file(image, filename = "craiyon.png", )) @bot.bridge_command() async def dm(ctx, member): user = bot.get_user(974149889187541093) await user.send("Hi!", tts=True) @bot.bridge_command() async def userinfo(ctx, member: discord.Member = None): if not member: # if member is no mentioned member = ctx.author # set member as the author embed = discord.Embed(colour=discord.Colour.purple(), timestamp=ctx.author.created_at, title=f"User Info - {member}") embed.set_thumbnail(url=member.display_avatar) embed.set_footer(text=f"Requested by {ctx.author}") embed.add_field(name="ID:", value=member.id) embed.add_field(name="Display Name:", value=member.display_name) embed.add_field(name="Created Account On:", value=member.created_at.strftime("%a, %#d %B %Y, %I:%M %p UTC")) embed.add_field(name="Joined Server On:", value=member.joined_at.strftime("%a, %#d %B %Y, %I:%M %p UTC")) embed.add_field(name="Highest Role:", value=member.top_role.mention) print(f"Requested by {ctx.author}") await ctx.respond(embed=embed)