an OSU! bot sdk based on IRC

Overview

osu-bot-sdk

  • an OSU! bot sdk based on IRC

Start!

  • The following is an example of event triggering
import osu_irc_sdk
from osu_irc_sdk import models

bot = osu_irc_sdk.OsuBot("your name", "your password", debug=True)  # see: https://osu.ppy.sh/p/irc

@bot.receiver(models.Codes.run_after_start)
def rrr():
    # Create a game room immediately after startup
    bot.logger("create room", bot.api.room_create("my test room", "114514", True, 4), test=True)


@bot.receiver(models.Codes.someone_joined_room)
def join(event: models.Message):
    bot.logger(f"{event.name} joined: {event.message}", test=True)


@bot.receiver(models.Codes.private_message)
def pmessage(event: models.Message):
    bot.logger(f"Get private chat: {event.name} - {event.message}")
    # bot.api.send_private_message(event.name, f"我是复读机: {event.message}")


@bot.receiver(models.Codes.channel_message)
def cmessage(event: models.Message):
    bot.logger(f"Message from {event.channel_id} :{event.name} - {event.message}")
    # bot.api.send_private_message(event.channel_id, f"{event.message}")

@bot.receiver(models.Codes.someone_joined_slot)
def join_slot(event: models.Message):
    bot.logger(f"{event.name} joined {event.channel_id} - {event.message} slot", test=True)
    if bot.name == event.name:
        bot.api.room_set_host(event.channel_id, event.name)


@bot.receiver(models.Codes.someone_changed_slot)
def change_slot(event: models.Message):
    bot.logger(f"{event.name} in {event.channel_id}, moved to {event.message} slot", test=True)


@bot.receiver(models.Codes.changed_song)
def cs(event: models.Message):
    bot.logger(f"room: {event.channel_id} changed song: {event.message}", test=True)

@bot.receiver(models.Codes.someone_left_room)
def lft(event: models.Message):
    bot.logger(f"{event.name} left: {event.channel_id}", test=True)

@bot.receiver(models.Codes.changed_host)
def chst(event: models.Message):
    bot.logger(f"{event.name} became the host of {event.channel_id}", test=True)

@bot.receiver(models.Codes.match_closed)
def clst(event: models.Message):
    bot.logger(f"room {event.channel_id} closed", test=True)

@bot.receiver(models.Codes.all_players_are_ready)
def rdy(event: models.Message):
    bot.logger(f"room: {event.channel_id} all players are ready", test=True)

@bot.receiver(models.Codes.user_finished_playing)
def fsh(event: models.UserGrade):
    bot.logger(f"room: {event.channel_id} player: {event.name} completed game, score: {event.score}, is_pass: {event.is_pass}",
               test=True)

@bot.receiver(models.Codes.host_is_changing_map)
def cmp(event: models.Message):
    bot.logger(f"room: {event.channel_id} is revising map", test=True)

@bot.receiver(models.Codes.match_has_started)
def stt(event: models.Message):
    bot.logger(f"room: {event.channel_id} started the match", test=True)

@bot.receiver(models.Codes.match_finished)
def stf(event: models.Message):
    bot.logger(f"room: {event.channel_id} - match has finished", test=True)


bot.strat()

Events

  • models.Codes
run_after_start  # This is a special event that will be executed immediately after successfully connecting to Bancho.
channel_message  # messages from room
private_message  # private message
someone_joined_room  # triggered only when a room is created
someone_joined_slot  # someone joined room
someone_changed_slot
changed_song
changed_host
someone_left_room
match_closed  # room closed
all_players_are_ready
user_finished_playing  # someone finished playing
host_is_changing_map
match_has_started
match_finished  # all players complete

API

  • OsuBot.api
send_private_message(username, message)
send_channel_message(room_id, message)  # commands are also ok
room_create(room_name, passwd="", free_mods=False, max_member="")  # it will return the room_id
room_set_passwd(room_id, passwd)
room_set_max_member(room_id, max_member)
room_set_host(room_id, host_name)
room_set_mods(room_id, mods)
room_strat_game(room_id)
room_change_map(room_id, map_id, mode="")  # mode:0/1/2/3
Owner
chinosk
awa
chinosk
Account Profiles Dumper for Fortnite.

Fortnite Profile Dumper This program allows you to dump your Fortnite account profiles. How to use it? After starting the FortniteProfileDumper.py, yo

PRO100KatYT 12 Jul 28, 2022
Python API client library for phpIPAM installations

phpypam: Python API client library for phpIPAM installation As we started to develop phpipam-ansible-modules we used an existing python library for ph

codeaffen 3 Aug 03, 2022
Repository containing the project files for CEN4020's Team Utah.

inCollege-Team-Utah Repository containing the project files for CEN4020's Team Utah. Contributors: Deepak Putta Jose Ramirez Fuentes Jaason Raudales C

Keylin Sanchez 3 Jul 12, 2022
Technical Test - Python Programmer Grupo Nexxera

Technical Test Nexxera Group Teste Técnico - Grupo de Programadores Python Nexxera 📍 Prepare-se para usar a API Nossa API de transações de contas dig

Raul dos Santos Moraes 1 Mar 16, 2022
Herramienta para transferir eventos de Sucuri WAF hacia Azure Blob Storage.

Transfiere eventos de Sucuri hacia Azure Blob Storage Script para transferir eventos del Sucuri Web Application Firewall (WAF) hacia Azure Blob Storag

CSIRT-RD 1 Dec 22, 2021
微信支付接口V3版python库

wechatpayv3 介绍 微信支付接口V3版python库。 适用对象 wechatpayv3支持微信支付直连商户,接口说明详见 官网。 特性 平台证书自动更新,无需开发者关注平台证书有效性,无需手动下载更新; 支持本地缓存平台证书,初始化时指定平台证书保存目录即可。 适配进度 微信支付V3版A

chen gang 258 Jan 06, 2023
in-progress decompilation of Gauntlet Legends decompression code on the N64

Gauntlet-Legends A in-progress decompilation of Gauntlet-Legends (N64) decompression code. This project currently supports the US release. Building (L

6 Jul 23, 2022
Unofficial YooMoney API python library

API Yoomoney - unofficial python library This is an unofficial YooMoney API python library. Summary Introduction Features Installation Quick start Acc

Aleksey Korshuk 136 Dec 30, 2022
Asynchronous Guilded API wrapper for Python

Welcome to guilded.py, a discord.py-esque asynchronous Python wrapper for the Guilded API. If you know discord.py, you know guilded.py. Documentation

shay 115 Dec 30, 2022
A Python Tumblr API v2 Client

PyTumblr Installation Install via pip: $ pip install pytumblr Install from source: $ git clone https://github.com/tumblr/pytumblr.git $ cd pytumblr $

Tumblr 677 Dec 21, 2022
Weee - Advanced project's versions bumper

Weee - Advanced project's versions bumper

Yan Kurbatov 2 Jun 06, 2022
Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs.

Twython Twython is a Python library providing an easy way to access Twitter data. Supports Python 3. It's been battle tested by companies, educational

Ryan McGrath 1.9k Jan 02, 2023
This is a very simple botnet with a CnC server, made by me. Feel free to change anything

This is a very simple botnet with a CnC server, made by me. Feel free to change anything

8 Nov 12, 2022
A Discord API Wrapper for Userbots/Selfbots written in Python.

DisCum A simple, easy to use, non-restrictive, synchronous Discord API Wrapper for Selfbots/Userbots written in Python. -using requests and websockets

Liam 450 Dec 27, 2022
RDMAss - A Python Discord bot creating an interaction with RDM API

RDMAss A Python Discord bot creating an interaction with RDM API. Features Assig

5 Sep 21, 2022
Live Coding - Mensageria na AWS com Amazon SNS e Amazon SQS

Live Coding - Mensageria na AWS com Amazon SNS e Amazon SQS Repositório para o Live Coding do dia 08/12/2021 Serviços utilizados Amazon SNS Amazon SQS

Cassiano Ricardo de Oliveira Peres 3 Mar 01, 2022
This discord bot preview user 42intra login picture.

42intra_Pic BOT This discord bot preview user 42intra login picture. created by: @YOPI#8626 Using: Python 3.9 (64-bit) (You don't need 3.9 but some fu

Zakaria Yacoubi 7 Mar 22, 2022
Discord Bot that can translate your text, count and reply to your messages with a personalised text

Discord Bot that can translate your text, count and reply to your messages with a personalised text

Grizz 2 Jan 26, 2022
BanAllBot - Telegram Code To Ban All Group Members very fast

BanAllBot Telegram Code To Ban All Group Members very fast FORK AND KANG WITH CR

27 May 13, 2022
Estimate the total emissions for popular CryptoArt platforms.

cryptoart-footprint Estimate the total CO2 footprint for popular CryptoArt platforms. The goal is to accurately quantify the ecological damage of Ethe

Kyle McDonald 182 Oct 12, 2022