DragonDice

Check-in [78c8dcaa73]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added /name command
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256: 78c8dcaa731e601f0c40f5767f88ce728cdf3c73f78e1aa1b6ece1a2c323921c
User & Date: murphy 2020-06-20 17:07:13
Context
2020-06-20
17:07
Added /name command Leaf check-in: 78c8dcaa73 user: murphy tags: trunk
17:06
Removed foreign VCS files check-in: 2a75ccbb49 user: murphy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to DragonDice.Bot/Session.fs.

248
249
250
251
252
253
254

255
256
257
258
259
260
261
...
709
710
711
712
713
714
715







716
717
718
719
720
721
722
""",
          List.empty
        )

      | ["/start" | "/help"; "create"] ->
        return Markup (
          """<b>Character Design:</b>

/create [<i>NAME</i>] — Create a new character and select it for the user who is asking.
/open5e <i>QUERY</i> — Import a new character from Open5e and select it for the user who is asking.
/setname <i>NAME</i> — Change the name of the active character.
/setrace <i>RACE</i> — Change the race of the active character. This operation does not work on imported characters.
/set ac =|+=|-= <i>N</i> — Change the armor class of the active character.
/set hp =|+=|-= <i>N</i> — Change the maximum hit points of the active character.
/set <i>SPEED</i> =|+=|-= <i>N</i> — Change a movement speed of the active character.
................................................................................
            characters
            |> Map.find name
        lock selectedCharacters (fun () -> selectedCharacters.[user.Id] <- chr)
        return Markup (
          sprintf "<i>%s</i> : Selected for %s" (HttpUtility.HtmlEncode chr.Name) (userMarkup user),
          List.empty
        )







        
      | ["/create"] ->
        let chr = Character(Name = lock random (fun () -> Name.random random))
        storedCharacters.SaveCharacterForUser(string user.Id, chr)
        lock selectedCharacters (fun () -> selectedCharacters.[user.Id] <- chr)
        return Markup (
          sprintf "<i>%s</i> : Created for %s" (HttpUtility.HtmlEncode chr.Name) (userMarkup user),







>







 







>
>
>
>
>
>
>







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
...
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
""",
          List.empty
        )

      | ["/start" | "/help"; "create"] ->
        return Markup (
          """<b>Character Design:</b>
/name — Generate a random name.
/create [<i>NAME</i>] — Create a new character and select it for the user who is asking.
/open5e <i>QUERY</i> — Import a new character from Open5e and select it for the user who is asking.
/setname <i>NAME</i> — Change the name of the active character.
/setrace <i>RACE</i> — Change the race of the active character. This operation does not work on imported characters.
/set ac =|+=|-= <i>N</i> — Change the armor class of the active character.
/set hp =|+=|-= <i>N</i> — Change the maximum hit points of the active character.
/set <i>SPEED</i> =|+=|-= <i>N</i> — Change a movement speed of the active character.
................................................................................
            characters
            |> Map.find name
        lock selectedCharacters (fun () -> selectedCharacters.[user.Id] <- chr)
        return Markup (
          sprintf "<i>%s</i> : Selected for %s" (HttpUtility.HtmlEncode chr.Name) (userMarkup user),
          List.empty
        )
        
      | ["/name"] ->
        let name = lock random (fun () -> Name.random random)
        return Markup (
          HttpUtility.HtmlEncode name,
          List.empty
        )
        
      | ["/create"] ->
        let chr = Character(Name = lock random (fun () -> Name.random random))
        storedCharacters.SaveCharacterForUser(string user.Id, chr)
        lock selectedCharacters (fun () -> selectedCharacters.[user.Id] <- chr)
        return Markup (
          sprintf "<i>%s</i> : Created for %s" (HttpUtility.HtmlEncode chr.Name) (userMarkup user),