Added fractale module
This commit is contained in:
parent
76470a5215
commit
b8926d4265
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
|||||||
[submodule "fractale"]
|
[submodule "fractale"]
|
||||||
path = fractale
|
path = fractale
|
||||||
url = https://moriya.zapto.org/LCI/fractale.git
|
url = https://moriya.zapto.org/LCI/LBI
|
||||||
|
2
fractale
2
fractale
@ -1 +1 @@
|
|||||||
Subproject commit f8a0d2c07e5f5e67674cd266f875be6f969a5418
|
Subproject commit 6531ad8a87cd4400c0c2438e3cc6022b412e5b35
|
4
main.py
4
main.py
@ -4,9 +4,9 @@ import os
|
|||||||
import importlib
|
import importlib
|
||||||
import traceback
|
import traceback
|
||||||
client = discord.Client()
|
client = discord.Client()
|
||||||
prefix='//'
|
prefix=";"
|
||||||
modules={} # format : {'modulename':[module, initializedclass]}
|
modules={} # format : {'modulename':[module, initializedclass]}
|
||||||
owners=[281166473102098433]
|
owners=[281166473102098433, 318866596502306816, 436105272310759426]
|
||||||
async def auth(user, moduleName):
|
async def auth(user, moduleName):
|
||||||
if user.id in owners:
|
if user.id in owners:
|
||||||
return True
|
return True
|
||||||
|
@ -21,13 +21,15 @@ class MainClass():
|
|||||||
|
|
||||||
def saveExists(self, objectname):
|
def saveExists(self, objectname):
|
||||||
return os.path.isfile("storage/%s/"%moduleFiles + objectname)
|
return os.path.isfile("storage/%s/"%moduleFiles + objectname)
|
||||||
def __init__(self, client, modules, owners):
|
def __init__(self, client, modules, owners, prefix):
|
||||||
if not os.path.isdir("storage/%s"%moduleFiles):
|
if not os.path.isdir("storage/%s"%moduleFiles):
|
||||||
call(['mkdir', 'storage/%s'%moduleFiles])
|
call(['mkdir', 'storage/%s'%moduleFiles])
|
||||||
self.errorsDeque=None
|
self.errorsDeque=None
|
||||||
self.devchanids=[549662392120901633]
|
self.devchanids=[549662392120901633]
|
||||||
self.memes=[
|
self.memes=[
|
||||||
"https://moriya.zapto.org/avatars/5?s=140"
|
"https://cdn.discordapp.com/avatars/436105272310759426/6e6850c03fba976f45295a76410a6699.png?size=64",
|
||||||
|
"https://cdn.discordapp.com/avatars/281166473102098433/6e92bff42c9f409334e1580c9f666228.png?size=64",
|
||||||
|
"https://cdn.discordapp.com/avatars/318866596502306816/8e1792132f5b9ceaca6f7aea1fd489f0.png?size=64"
|
||||||
]
|
]
|
||||||
self.icon="https://moriya.zapto.org/avatars/5?s=140"
|
self.icon="https://moriya.zapto.org/avatars/5?s=140"
|
||||||
self.client = client
|
self.client = client
|
||||||
|
29
modules/fractale.py
Normal file
29
modules/fractale.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#dummy module
|
||||||
|
import asyncio
|
||||||
|
import fractale.source.betterTurtle
|
||||||
|
import random
|
||||||
|
import discord
|
||||||
|
class MainClass():
|
||||||
|
def __init__(self, client, modules, owners, prefix):
|
||||||
|
self.client = client
|
||||||
|
self.modules = modules
|
||||||
|
self.owners = owners
|
||||||
|
self.prefix = prefix
|
||||||
|
self.events=['on_message'] #events list
|
||||||
|
self.command="%sfractale"%self.prefix #command prefix (can be empty to catch every single messages)
|
||||||
|
|
||||||
|
self.name="Fractale"
|
||||||
|
self.description="Module de génération de fractales"
|
||||||
|
self.interactive=True
|
||||||
|
self.color=0x78ffc3
|
||||||
|
self.help="""\
|
||||||
|
</prefix>fractale
|
||||||
|
=> Génère une image fractale.
|
||||||
|
"""
|
||||||
|
async def on_message(self, message):
|
||||||
|
tmpstr="/tmp/%s.png"%random.randint(1,10000000)
|
||||||
|
t = fractale.source.betterTurtle.Turtle(size=(10000, 10000), resolution=1)
|
||||||
|
t.set_position((0, 0))
|
||||||
|
t.fractal.outline(8, 40, 4)
|
||||||
|
t.save(tmpstr)
|
||||||
|
await message.channel.send(file=discord.File(tmpstr))
|
@ -21,7 +21,7 @@ class MainClass():
|
|||||||
self.name="Modules"
|
self.name="Modules"
|
||||||
self.description="Module de gestion des modules"
|
self.description="Module de gestion des modules"
|
||||||
self.interactive=True
|
self.interactive=True
|
||||||
self.authlist=[431043517217898496]
|
self.authlist=[549662392120901633]
|
||||||
self.color=0x8f3196
|
self.color=0x8f3196
|
||||||
self.help="""\
|
self.help="""\
|
||||||
</prefix>modules list
|
</prefix>modules list
|
||||||
|
@ -12,7 +12,7 @@ class MainClass():
|
|||||||
self.name="Restart"
|
self.name="Restart"
|
||||||
self.description="Module gérant les redémarrages du bot"
|
self.description="Module gérant les redémarrages du bot"
|
||||||
self.interactive=True
|
self.interactive=True
|
||||||
self.authlist=[431043517217898496]
|
self.authlist=[549662392120901633]
|
||||||
self.color=0x000000
|
self.color=0x000000
|
||||||
self.help="""\
|
self.help="""\
|
||||||
</prefix>restart
|
</prefix>restart
|
||||||
|
Loading…
Reference in New Issue
Block a user