underware-gg / pistols-discord-bot

A Discord bot for Pistols at 10 Blocks
https://pistols-social-app.vercel.app
Creative Commons Zero v1.0 Universal
1 stars 3 forks source link

bot: Duel listing commands #2

Closed rsodre closed 6 months ago

rsodre commented 7 months ago

After #1 is complete, the live_duels command should be listing duel Ids. Let's make it useful!

Tasks

The Challenge and Duelist models:

#[derive(Model, Copy, Drop, Serde)]
struct Challenge {
    #[key]
    duel_id: u128,
    //-------------------------
    duelist_a: ContractAddress, // Challenger
    duelist_b: ContractAddress, // Challenged
    message: felt252,           // message to challenged
    // progress and results
    state: u8,                  // actually a ChallengeState
    round_number: u8,           // current or final
    winner: u8,                 // 0:draw, 1:duelist_a, 2:duelist_b
    // timestamps in unix epoch
    timestamp_start: u64,       // Unix time, started
    timestamp_end: u64,         // Unix time, ended
}

#[derive(Model, Copy, Drop, Serde)]
struct Duelist {
    #[key]
    address: ContractAddress,
    //-----------------------
    name: felt252,
    profile_pic: u8,
    total_duels: u16,
    total_wins: u16,
    total_losses: u16,
    total_draws: u16,
    total_honour: u32,  // sum of al duels Honour
    honour: u8,         // +1 decimal, eg: 100 = 10.0
    timestamp: u64,     // Unix time, 1st registered
}

Notes

A little guide for creating new commands...

Reference

const url = `${process.env.game_url}/profiles/${duelist.profile_pic}_sq.jpg`
Screenshot 2024-04-20 at 19 44 13 Screenshot 2024-04-20 at 19 43 53
Ugo-X commented 7 months ago

Hello, @rsodre would love to be part of this effort! thanks (I am on the OD Hack telegram group, ready to start on Monday )

Ugo-X commented 7 months ago

Hello, @rsodre would love to be part of this effort! it's Monday already, thanks

Ugo-X commented 7 months ago

@rsodre Good day, i would love to contribute to this effort, please can i be assigned this task?

rsodre commented 7 months ago

@rsodre Good day, i would love to contribute to this effort, please can i be assigned this task?

When #1 is ready ;)

Dprof-in-tech commented 6 months ago

Hello @rsodre , its Isaac here. I would love to work on this task