Hey !
Voici un petit programme python qui permet grâce a un bot discord et a la commandes .qrcode <lien> <file_name> de créer un qrcode:
import discord
from discord import file
from discord.ext import commands
from qrcode import make
import os
from keep_alive import keep_alive
MyToken = os.environ['Token']
bot = commands.Bot(command_prefix=".", help_command=None, description=None)
@bot.event
async def on_ready():
print("Bot prét !")
@bot.command()
async def qrcode(ctx, url = None, *, namefile = "qrcode"):
if url == None:
await ctx.send("**Please specify the redirection url of the qrcode.**")
else:
img = make(url)
img.save(f"image/{namefile}.png")
await ctx.send("**Creation of the qrcode, please wait...**")
qrcode_img = discord.File(f"image/{namefile}.png")
await ctx.send(file=qrcode_img)
os.remove(f"image/{namefile}.png")
keep_alive()
bot.run(MyToken)