A Discord bot for TFT Ultimate Bravery rolls rollbot.bpev.me
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: update set name via action

Ben Pevsner (Dec 30, 2022, 10:40 AM +0800) d6e480b4 16e23769

+244 -187
+184 -181
db/data.json
··· 1 1 { 2 - "Civilian": [ 3 - "Galio", 4 - "Sivir", 5 - "Janna" 6 - ], 7 - "A.D.M.I.N.": [ 8 - "Blitzcrank", 9 - "Camille", 10 - "Soraka", 11 - "LeBlanc" 12 - ], 13 - "Anima Squad": [ 14 - "Sylas", 15 - "Nasus", 16 - "Jinx", 17 - "Vayne", 18 - "Riven", 19 - "Miss Fortune" 20 - ], 21 - "LaserCorps": [ 22 - "Sejuani", 23 - "Ashe", 24 - "Senna", 25 - "Zed", 26 - "Mordekaiser", 27 - "Yasuo", 28 - "Renekton" 29 - ], 30 - "Brawler": [ 31 - "Riven", 32 - "Jax", 33 - "Sejuani", 34 - "Vi", 35 - "Blitzcrank", 36 - "Lee Sin", 37 - "Renekton" 38 - ], 39 - "Mecha:PRIME": [ 40 - "Sett", 41 - "Draven", 42 - "Leona", 43 - "Jax", 44 - "Wukong" 45 - ], 46 - "Threat": [ 47 - "Vel'Koz", 48 - "Cho'Gath", 49 - "Aurelion Sol", 50 - "Rammus", 51 - "Bel'Veth", 52 - "Zac", 53 - "Urgot", 54 - "Fiddlesticks" 55 - ], 56 - "Mascot": [ 57 - "Nasus", 58 - "Galio", 59 - "Alistar", 60 - "Nunu & Willump", 61 - "Malphite", 62 - "Yuumi" 63 - ], 64 - "Forecaster": [ 65 - "Janna" 66 - ], 67 - "Ace": [ 68 - "Miss Fortune", 69 - "Draven", 70 - "Mordekaiser", 71 - "Samira" 72 - ], 73 - "Duelist": [ 74 - "Vayne", 75 - "Nilah", 76 - "Zed", 77 - "Fiora", 78 - "Kayle", 79 - "Gangplank", 80 - "Yasuo" 81 - ], 82 - "Ox Force": [ 83 - "Annie", 84 - "Fiora", 85 - "Alistar", 86 - "Aphelios", 87 - "Viego", 88 - "Talon" 89 - ], 90 - "Arsenal": [ 91 - "Aphelios" 92 - ], 93 - "Aegis": [ 94 - "Ekko", 95 - "Leona", 96 - "Alistar", 97 - "Vi" 98 - ], 99 - "Underground": [ 100 - "Kayle", 101 - "Vi", 102 - "Samira", 103 - "Sona", 104 - "Ezreal" 105 - ], 106 - "Star Guardian": [ 107 - "Taliyah", 108 - "Lux", 109 - "Nilah", 110 - "Kai'Sa", 111 - "Rell", 112 - "Ekko", 113 - "Syndra", 114 - "Yuumi" 115 - ], 116 - "Prankster": [ 117 - "Jinx", 118 - "Ekko", 119 - "Zoe" 120 - ], 121 - "Heart": [ 122 - "Syndra", 123 - "Sona", 124 - "Lulu", 125 - "Lee Sin", 126 - "Yuumi", 127 - "Soraka" 128 - ], 129 - "Corrupted": [ 130 - "Fiddlesticks" 131 - ], 132 - "Supers": [ 133 - "Gangplank", 134 - "Lee Sin", 135 - "Malphite" 136 - ], 137 - "Renegade": [ 138 - "Sylas", 139 - "Leona", 140 - "Viego", 141 - "Camille", 142 - "Talon" 143 - ], 144 - "Spellslinger": [ 145 - "Janna", 146 - "Taliyah", 147 - "Lux", 148 - "Annie", 149 - "Sona", 150 - "LeBlanc" 151 - ], 152 - "Recon": [ 153 - "Vayne", 154 - "Kai'Sa", 155 - "Ashe", 156 - "Ezreal" 157 - ], 158 - "Sureshot": [ 159 - "Sivir", 160 - "Senna", 161 - "Aphelios", 162 - "Samira" 163 - ], 164 - "Defender": [ 165 - "Riven", 166 - "Rell", 167 - "Sett", 168 - "Poppy", 169 - "Wukong" 170 - ], 171 - "Gadgeteen": [ 172 - "Annie", 173 - "Lulu", 174 - "Zoe", 175 - "Nunu & Willump", 176 - "Poppy" 177 - ], 178 - "Hacker": [ 179 - "Zed", 180 - "Zoe", 181 - "LeBlanc" 182 - ] 2 + "name": "TFTSet8", 3 + "traits": { 4 + "Civilian": [ 5 + "Galio", 6 + "Sivir", 7 + "Janna" 8 + ], 9 + "A.D.M.I.N.": [ 10 + "Blitzcrank", 11 + "Camille", 12 + "Soraka", 13 + "LeBlanc" 14 + ], 15 + "Anima Squad": [ 16 + "Sylas", 17 + "Nasus", 18 + "Jinx", 19 + "Vayne", 20 + "Riven", 21 + "Miss Fortune" 22 + ], 23 + "LaserCorps": [ 24 + "Sejuani", 25 + "Ashe", 26 + "Senna", 27 + "Zed", 28 + "Mordekaiser", 29 + "Yasuo", 30 + "Renekton" 31 + ], 32 + "Brawler": [ 33 + "Riven", 34 + "Jax", 35 + "Sejuani", 36 + "Vi", 37 + "Blitzcrank", 38 + "Lee Sin", 39 + "Renekton" 40 + ], 41 + "Mecha:PRIME": [ 42 + "Sett", 43 + "Draven", 44 + "Leona", 45 + "Jax", 46 + "Wukong" 47 + ], 48 + "Threat": [ 49 + "Vel'Koz", 50 + "Cho'Gath", 51 + "Aurelion Sol", 52 + "Rammus", 53 + "Bel'Veth", 54 + "Zac", 55 + "Urgot", 56 + "Fiddlesticks" 57 + ], 58 + "Mascot": [ 59 + "Nasus", 60 + "Galio", 61 + "Alistar", 62 + "Nunu & Willump", 63 + "Malphite", 64 + "Yuumi" 65 + ], 66 + "Forecaster": [ 67 + "Janna" 68 + ], 69 + "Ace": [ 70 + "Miss Fortune", 71 + "Draven", 72 + "Mordekaiser", 73 + "Samira" 74 + ], 75 + "Duelist": [ 76 + "Vayne", 77 + "Nilah", 78 + "Zed", 79 + "Fiora", 80 + "Kayle", 81 + "Gangplank", 82 + "Yasuo" 83 + ], 84 + "Ox Force": [ 85 + "Annie", 86 + "Fiora", 87 + "Alistar", 88 + "Aphelios", 89 + "Viego", 90 + "Talon" 91 + ], 92 + "Arsenal": [ 93 + "Aphelios" 94 + ], 95 + "Aegis": [ 96 + "Ekko", 97 + "Leona", 98 + "Alistar", 99 + "Vi" 100 + ], 101 + "Underground": [ 102 + "Kayle", 103 + "Vi", 104 + "Samira", 105 + "Sona", 106 + "Ezreal" 107 + ], 108 + "Star Guardian": [ 109 + "Taliyah", 110 + "Lux", 111 + "Nilah", 112 + "Kai'Sa", 113 + "Rell", 114 + "Ekko", 115 + "Syndra", 116 + "Yuumi" 117 + ], 118 + "Prankster": [ 119 + "Jinx", 120 + "Ekko", 121 + "Zoe" 122 + ], 123 + "Heart": [ 124 + "Syndra", 125 + "Sona", 126 + "Lulu", 127 + "Lee Sin", 128 + "Yuumi", 129 + "Soraka" 130 + ], 131 + "Corrupted": [ 132 + "Fiddlesticks" 133 + ], 134 + "Supers": [ 135 + "Gangplank", 136 + "Lee Sin", 137 + "Malphite" 138 + ], 139 + "Renegade": [ 140 + "Sylas", 141 + "Leona", 142 + "Viego", 143 + "Camille", 144 + "Talon" 145 + ], 146 + "Spellslinger": [ 147 + "Janna", 148 + "Taliyah", 149 + "Lux", 150 + "Annie", 151 + "Sona", 152 + "LeBlanc" 153 + ], 154 + "Recon": [ 155 + "Vayne", 156 + "Kai'Sa", 157 + "Ashe", 158 + "Ezreal" 159 + ], 160 + "Sureshot": [ 161 + "Sivir", 162 + "Senna", 163 + "Aphelios", 164 + "Samira" 165 + ], 166 + "Defender": [ 167 + "Riven", 168 + "Rell", 169 + "Sett", 170 + "Poppy", 171 + "Wukong" 172 + ], 173 + "Gadgeteen": [ 174 + "Annie", 175 + "Lulu", 176 + "Zoe", 177 + "Nunu & Willump", 178 + "Poppy" 179 + ], 180 + "Hacker": [ 181 + "Zed", 182 + "Zoe", 183 + "LeBlanc" 184 + ] 185 + } 183 186 }
+1 -1
db/list_sets.ts
··· 1 1 const resp = await fetch('https://raw.communitydragon.org/latest/cdragon/tft/en_us.json'); 2 2 const data = await resp.json(); 3 - const setNames = Object.keys(data.sets); 3 + const setNames = data.setData.map(setData => setData.mutator); 4 4 console.log(setNames);
+4 -1
db/update.ts
··· 68 68 }); 69 69 }); 70 70 71 - Deno.writeTextFileSync(`./db/data.json`, JSON.stringify(results, null, 2)); 71 + Deno.writeTextFileSync(`./db/data.json`, JSON.stringify({ 72 + name: setName, 73 + traits: results 74 + }, null, 2));
+1
deno.json
··· 7 7 "tasks": { 8 8 "roll": "deno run source/cli.ts", 9 9 "db:update": "deno run --allow-net --allow-write db/update.ts", 10 + "db:list": "deno run --allow-net --allow-write db/list_sets.ts", 10 11 "discord:setup": "deno run --allow-env --allow-net --allow-read source/discord_setup.ts", 11 12 "discord:serve": "deno run --allow-env --allow-net --allow-read source/discord_serve.ts" 12 13 }
+47
deno.lock
··· 1 + { 2 + "version": "2", 3 + "remote": { 4 + "https://cdn.skypack.dev/-/http-cache-semantics@v4.1.0-5IkAyzxageW9utYlM9Kq/dist=es2019,mode=imports/optimized/http-cache-semantics.js": "abb90d8731ed016549017a010e198e5075e5ca5308bfe429b7acaa07c3fe7200", 5 + "https://cdn.skypack.dev/-/http-cache-semantics@v4.1.0-5IkAyzxageW9utYlM9Kq/dist=es2019,mode=types/index.d.ts": "0bf440ab914e79e890cb15e5ffacb5e18bec678338b3eab069a5829d3d5c96e3", 6 + "https://cdn.skypack.dev/-/tweetnacl@v1.0.3-G4yM3nQ8lnXXlGGQADqJ/dist=es2019,mode=imports/optimized/tweetnacl.js": "d26554516df57e5cb58954e90c633c8871b4e66016b9fe4e07a36db5430bc8c7", 7 + "https://cdn.skypack.dev/-/tweetnacl@v1.0.3-G4yM3nQ8lnXXlGGQADqJ/dist=es2019,mode=types/nacl.d.ts": "60592f5ae1b739c9607a99895d4a3ad5c865b16903e4180e50b256e360a4a104", 8 + "https://cdn.skypack.dev/http-cache-semantics?dts": "dc31b1d6078daceb7667ec025de2206541c4f1c8fe480836bbaf9f8f666f9880", 9 + "https://cdn.skypack.dev/tweetnacl@v1.0.3?dts": "6610aad2ac175c2d575995fc7de8ed552c2e5e05aef80ed8588cf3c6e2db61d7", 10 + "https://deno.land/std@0.118.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58", 11 + "https://deno.land/std@0.118.0/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac", 12 + "https://deno.land/std@0.118.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853", 13 + "https://deno.land/std@0.118.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", 14 + "https://deno.land/std@0.118.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", 15 + "https://deno.land/std@0.118.0/path/common.ts": "f41a38a0719a1e85aa11c6ba3bea5e37c15dd009d705bd8873f94c833568cbc4", 16 + "https://deno.land/std@0.118.0/path/glob.ts": "ea87985765b977cc284b92771003b2070c440e0807c90e1eb0ff3e095911a820", 17 + "https://deno.land/std@0.118.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12", 18 + "https://deno.land/std@0.118.0/path/posix.ts": "34349174b9cd121625a2810837a82dd8b986bbaaad5ade690d1de75bbb4555b2", 19 + "https://deno.land/std@0.118.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c", 20 + "https://deno.land/std@0.118.0/path/win32.ts": "11549e8c6df8307a8efcfa47ad7b2a75da743eac7d4c89c9723a944661c8bd2e", 21 + "https://deno.land/std@0.130.0/async/abortable.ts": "a896ac6b0d4237bd2d2d248217cfa1f0d85ccda93cb25ebda55e33850e526be6", 22 + "https://deno.land/std@0.130.0/async/deadline.ts": "48ac998d7564969f3e6ec6b6f9bf0217ebd00239b1b2292feba61272d5dd58d0", 23 + "https://deno.land/std@0.130.0/async/debounce.ts": "564273ef242bcfcda19a439132f940db8694173abffc159ea34f07d18fc42620", 24 + "https://deno.land/std@0.130.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a", 25 + "https://deno.land/std@0.130.0/async/delay.ts": "cbbdf1c87d1aed8edc7bae13592fb3e27e3106e0748f089c263390d4f49e5f6c", 26 + "https://deno.land/std@0.130.0/async/mod.ts": "2240c6841157738414331f47dee09bb8c0482c5b1980b6e3234dd03515c8132f", 27 + "https://deno.land/std@0.130.0/async/mux_async_iterator.ts": "f4d1d259b0c694d381770ddaaa4b799a94843eba80c17f4a2ec2949168e52d1e", 28 + "https://deno.land/std@0.130.0/async/pool.ts": "97b0dd27c69544e374df857a40902e74e39532f226005543eabacb551e277082", 29 + "https://deno.land/std@0.130.0/async/tee.ts": "1341feb1f5b1a96f8628d0f8fc07d8c43d3813423f18a63bf1b4785568d21b1f", 30 + "https://deno.land/std@0.130.0/http/http_status.ts": "71838ad33cb03ff2575f5e8fdea5f930979cdff8a81c11ade497f11d4c026019", 31 + "https://deno.land/std@0.130.0/http/server.ts": "10c3a7814666cdbabd6f9c18acdcc4593e222275a628280a4868881445fbb5bc", 32 + "https://deno.land/x/dotenv@v3.2.0/load.ts": "cbd76a0aee01aad8d09222afaa1dd04b84d9d3e44637503b01bf77a91df9e041", 33 + "https://deno.land/x/dotenv@v3.2.0/mod.ts": "077b48773de9205266a0b44c3c3a3c3083449ed64bb0b6cc461b95720678d38e", 34 + "https://deno.land/x/dotenv@v3.2.0/util.ts": "693730877b13f8ead2b79b2aa31e2a0652862f7dc0c5f6d2f313f4d39c7b7670", 35 + "https://deno.land/x/httpcache@0.1.2/in_memory.ts": "9f7d2d1600f64934c45493bf300475f3edef8ca540da60f308bda32d30de849e", 36 + "https://deno.land/x/httpcache@0.1.2/mod.ts": "1247683a7e4f573759afb47709b2b5cd954986cfc4882ed7cc3a21b0e959be58", 37 + "https://deno.land/x/lru@1.0.2/mod.ts": "1d44b87c4d40ff33749ae5fd85fe234344e0dace835fdfeb48413edea9461159", 38 + "https://deno.land/x/media_types@v2.11.1/db.ts": "1eac2b1b57195e41d7e40d7b236a3adeb93b4fa18084b4c9db49144fe685c78d", 39 + "https://deno.land/x/media_types@v2.11.1/mod.ts": "1be09ec3626332f9fe52a8a9ede852bb76d2207f84bec1f1b16c10555478008f", 40 + "https://deno.land/x/sift@0.5.0/mod.ts": "900cc5dc7be287a48b1f4f036010334a92d1783fb8427c69ad40070dc6b918b4", 41 + "https://x.lcas.dev/preact@10.5.12/jsx.d.ts": "55e7b86443e17edf4252c12fc8114678c733f8831a81b622d49097f28b0be98b", 42 + "https://x.lcas.dev/preact@10.5.12/mod.d.ts": "1b7da14b252cc408c27429d0b8dfad08eac125daa054507b58435c4390dc7c99", 43 + "https://x.lcas.dev/preact@10.5.12/mod.js": "62eb264b333369c5c3f5186fc97964c1787f9352d52decfde9c50084add3a86f", 44 + "https://x.lcas.dev/preact@10.5.12/ssr.d.ts": "969fee1e06346d80d97414ffa0a49a13c0672462324a7f5e2e335662097ed595", 45 + "https://x.lcas.dev/preact@10.5.12/ssr.js": "17b5eebfac9321092cee4a6fcbf9a88885936824eadf2c1c16b297cb829721e1" 46 + } 47 + }
+4 -3
source/utilities/formatOutputString.ts
··· 1 + import data from "../../db/data.json" assert { type: "json" }; 2 + import { ENVIRONMENT, Environment } from "../constants.ts"; 1 3 import type { RollResult, RollResultCollection } from "./roll.ts"; 2 4 3 - import { ENVIRONMENT, Environment } from "../constants.ts"; 4 - 5 + const { name: setName } = data; 5 6 const { DISCORD, POWER_SHELL, TERMINAL } = ENVIRONMENT; 6 7 7 8 interface RollData extends RollResult { ··· 17 18 [TERMINAL]: formatPlayerTextForTerminal, 18 19 }; 19 20 20 - const titleText = "TFT RollBot (Season 7):\n\n"; 21 + const titleText = `TFT RollBot (Set "${setName}"):\n\n`; 21 22 22 23 export function formatOutputString( 23 24 rolls: RollResultCollection,
+3 -1
source/utilities/roll.ts
··· 1 - import traits from "../../db/data.json" assert { type: "json" }; 1 + import data from "../../db/data.json" assert { type: "json" }; 2 + 3 + const { traits } = data; 2 4 3 5 export interface RollResult { 4 6 king: string;