import { config } from "dotenv" ; import { Client } from "." ; config ( ) ; async function user ( ) { const client = new Client ( { apiURL : process . env . API_URL , debug : true , } ) ; client . on ( "ready" , async ( ) => { console . info ( `Logged in as ${ client . user ! . username }!` ) ; const group = await client . channels . createGroup ( { name : 'sussy' , nonce : '' + Math . random ( ) , users : [ ] } ) ; const msg = await group . sendMessage ( { content : "embed test" , embeds : [ { type : 'Text' , title : 'We do a little!' } ] } ) ; await msg . edit ( { embeds : [ { type : 'Text' , title : 'sus' } ] } ) ; } ) ; client . on ( "message" , async ( message ) => { if ( message . content === "sus" ) { message . channel ! . sendMessage ( "sus!" ) ; } else if ( message . content === "bot" ) { const bot = await client . req ( "POST" , "/bots/create" , { name : "basedbot12" , } ) ; message . channel ! . sendMessage ( JSON . stringify ( bot ) ) ; } else if ( message . content === "my bots" ) { message . channel ! . sendMessage ( JSON . stringify ( await client . req ( "GET" , "/bots/@me" ) ) ) ; } else if ( message . content === "join bot" ) { await client . req ( "POST" , `/bots/01FCV7DCMRD9MT3JBYT5VEKVRD/invite` as "/bots/id/invite" , { group : message . channel_id } ) ; } else if ( message . content === "edit bot name" ) { await client . req ( "PATCH" , `/bots/01FCV7DCMRD9MT3JBYT5VEKVRD` as "/bots/id" , { name : "testingbkaka" } ) ; } else if ( message . content === "make bot public" ) { await client . req ( "PATCH" , `/bots/01FCV7DCMRD9MT3JBYT5VEKVRD` as "/bots/id" , { public : true } ) ; } else if ( message . content === "delete bot" ) { await client . req ( "DELETE" , `/bots/01FCV7DCMRD9MT3JBYT5VEKVRD` as "/bots/id" ) ; } } ) ; try { await client . register ( { email : process . env . EMAIL as string , password : process . env . PASSWORD as string , } ) ; } catch ( err ) { } const onboarding = await client . login ( { email : process . env . EMAIL as string , password : process . env . PASSWORD as string , } ) ; onboarding ?. ( 'sus' , true ) ; } user ( ) ;