Coder Social home page Coder Social logo

from import BaseBot, ChatEvent, , main, UserJoinedEvent, UserLeftEvent, ) from .models import ( AnchorPosition, ChannelEvent, ChannelRequest, ChatEvent, ChatRequest, CurrencyItem, EmoteEvent, EmoteRequest, Error, FloorHitRequest, GetRoomUsersRequest, GetWalletRequest, IndicatorRequest, Item, Position, Reaction, ReactionEvent, ReactionRequest, SessionMetadata, TeleportRequest, TipReactionEvent, User, UserJoinedEvent, UserLeftEvent, ) from asyncio import run as arun import random

from webserver import keep_alive

class Bot(BaseBot):

async def on_start(self, SessionMetadata: SessionMetadata) -> None: await self..walk_to(Position(0.5, 0, 5)) await self..chat("Hey I'm Back! Sorry For Inconvenience")

async def on_user_join(self, user: User) -> None: print(f"@{user.username} Joined the room") await self..chat( f"\nWelcome @{user.username}! Blessed to have you here!\n")

async def on_tip(self, sender: User, receiver: User, tip: CurrencyItem | Item) -> None: print( f"{sender.username} tipped {receiver.username} an amount of {tip.amount}" ) goldAmount = tip.amount emoteId = 'idle-dance-casual' if goldAmount >= 5 and receiver.username == "iSeaweed": await self..chat( f"\nThank You {sender.username}!\nI'm so glad you tipped {tip.amount} to the host, keep showing love 💙" ) await self..send_emote(emoteId, sender.id) else: await self..chat( f"@{sender.username} tipped {tip.amount}G to the lovely @{receiver.username}" )

async def run(self, room_id, token): await main.main(self, room_id, token)

keep_alive() if name == "main": room_id = "6454da2e30bc9ce44d29e882" token = "55bfb3ae9d4389fd6d75ae4ce3c17a369cd28cde234c02d8b072a05d1605d58f" arun(Bot().run(room_id, token))

89265603369's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.