moves random function

This commit is contained in:
Skillz
2021-02-25 15:28:49 -05:00
parent 31da4ddee6
commit f1d4f35e46
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { chooseRandom } from "./utils.ts";
import { chooseRandom } from "./random.ts";
export class Collection<K, V> extends Map<K, V> {
maxSize?: number;
+3
View File
@@ -0,0 +1,3 @@
export function chooseRandom<T>(array: T[]) {
return array[Math.floor(Math.random() * array.length)];
}
-4
View File
@@ -27,10 +27,6 @@ export function editBotsStatus(
sendGatewayCommand("EDIT_BOTS_STATUS", { status, game: { name, type } });
}
export function chooseRandom<T>(array: T[]) {
return array[Math.floor(Math.random() * array.length)];
}
export async function urlToBase64(url: string) {
const buffer = await fetch(url).then((res) => res.arrayBuffer());
const imageStr = encode(buffer);