Remove testing scripts
This commit is contained in:
parent
6628b27ec3
commit
31b3f715e0
2 changed files with 0 additions and 80 deletions
25
DBTest.py
25
DBTest.py
|
|
@ -1,25 +0,0 @@
|
||||||
import asyncio
|
|
||||||
import yaboli
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ExampleDB(yaboli.Database):
|
|
||||||
@yaboli.Database.operation
|
|
||||||
def sample_operation(connection, *args):
|
|
||||||
print(args)
|
|
||||||
#return a + b
|
|
||||||
print("returning 15...")
|
|
||||||
return 15
|
|
||||||
|
|
||||||
async def run():
|
|
||||||
db = ExampleDB("test.db")
|
|
||||||
print(db.sample_operation)
|
|
||||||
#print(db.sample_operation(1, 2))
|
|
||||||
result = await db.sample_operation(1, 2)
|
|
||||||
print(result)
|
|
||||||
|
|
||||||
def main():
|
|
||||||
asyncio.get_event_loop().run_until_complete(run())
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
55
TestBot.py
55
TestBot.py
|
|
@ -1,55 +0,0 @@
|
||||||
import yaboli
|
|
||||||
from yaboli.utils import *
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestBot(yaboli.Bot):
|
|
||||||
def __init__(self, nick):
|
|
||||||
super().__init__(nick=nick)
|
|
||||||
|
|
||||||
self.register_callback("tree", self.command_tree, specific=False)
|
|
||||||
self.register_callback("stree", self.command_simple_tree, specific=False)
|
|
||||||
|
|
||||||
#async def on_send(self, message):
|
|
||||||
#if message.content == "!spawnevil":
|
|
||||||
#bot = TestBot("TestSpawn")
|
|
||||||
#task, reason = await bot.connect("test")
|
|
||||||
#second = await self.room.send("We have " + ("a" if task else "no") + " task. Reason: " + reason, message.message_id)
|
|
||||||
#if task:
|
|
||||||
#await bot.stop()
|
|
||||||
#await self.room.send("Stopped." if task.done() else "Still running (!)", second.message_id)
|
|
||||||
|
|
||||||
#await self.room.send("All's over now.", message.message_id)
|
|
||||||
|
|
||||||
#elif message.content == "!tree":
|
|
||||||
#messages = [message]
|
|
||||||
#newmessages = []
|
|
||||||
#for i in range(2):
|
|
||||||
#for m in messages:
|
|
||||||
#for j in range(2):
|
|
||||||
#newm = await self.room.send(f"{m.content}.{j}", m.message_id)
|
|
||||||
#newmessages.append(newm)
|
|
||||||
#messages = newmessages
|
|
||||||
#newmessages = []
|
|
||||||
|
|
||||||
async def command_tree(self, message, args):
|
|
||||||
messages = [message]
|
|
||||||
newmessages = []
|
|
||||||
for i in range(2):
|
|
||||||
for msg in messages:
|
|
||||||
for j in range(2):
|
|
||||||
newm = await self.room.send(f"{msg.content}.{j}", msg.message_id)
|
|
||||||
newmessages.append(newm)
|
|
||||||
messages = newmessages
|
|
||||||
newmessages = []
|
|
||||||
|
|
||||||
async def command_simple_tree(self, message, args):
|
|
||||||
root = await self.room.send("root message", message.message_id)
|
|
||||||
branch1 = await self.room.send("branch 1", root.message_id)
|
|
||||||
branch2 = await self.room.send("branch 2", root.message_id)
|
|
||||||
await self.room.send("branch 1.1", branch1.message_id)
|
|
||||||
await self.room.send("branch 2.1", branch2.message_id)
|
|
||||||
await self.room.send("branch 1.2", branch1.message_id)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
run_bot(TestBot, "test", "TestSummoner")
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue