Skip to content

mochagod123/chaat.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

chaat.py

c.kuku.luの非公式ライブラリ

サンプルコード

import chatroom
import time

bot = chatroom.WebSocket()

@bot.command(name="test")
async def test_command(ctx: chatroom.Context, *args):
    print(await ctx.room.send("こんばんは!"))

@bot.command(name="create")
async def create_command(ctx: chatroom.Context, *args):
    room = await bot.create_room()
    await ctx.room.send(room.url)
    await bot.join_room(room)

# イベント
@bot.event
async def on_chat(message: chatroom.Message):
    # メッセージ受信
    if message.content == "こんばんは":
        await message.room.send("こんばんは!")
    await bot.process_command(message)

# ログイン
hash = bot.url_to_hash("URL")

bot.login(hash)

discord.py風になりました。

About

c.kuku.luの非公式ライブラリ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages