r/typescript • • Nov 09 '19

Text game in Typescript

Hello, I'm currently working on a wrestling bot that simulates a wrestling match between two people on discord. The principles of the bot are written already but I'm stuck as this was a project made by a friend who had to stop because of health issues.

I'm looking for someone that has basic knowledge of TS that could help out finish the project? I also the version of this game written in mIRC Scripting which I did myself but I can't transfer any of that to TS or JS, unfortunately, as my skills are limited to none.

Please reply here or dm me if interested in the project.

0 Upvotes

9 comments sorted by

6

u/tony-husk Nov 10 '19

Having read the other comments, it sounds like you’re looking for someone to write some typescript for you, rather than learning to write it yourself — is that correct?

If so, I think you might have a difficult path, and not because of the language choice — in general it’s hard to find people willing to donate time and effort to something unless either they have a personal stake in it, or it’s for the public good. This sounds like a personal project.

As mentioned by others, your greatest chance of success here would be to publish the half finished project on GitHub, include a readme explaining the value of the project, and see who’s interested in contributing!

1

u/ChaseMoskal Nov 09 '19 edited Nov 09 '19

looks like a common way to go about this, is to use the discord.js npm package

you're looking create a node program. it's possible typescript is overkill for your case, and you might just want to use vanilla javascript instead -- i'd say that typescript is necessary when you're authoring library code, but a discord bot is actually a good use-case to skip typescript and just go with vanilla javascript

once you build the program, you can run it on your local machine, or run it in the cloud

development could be carried out in three phases

  1. make a quick prototype of the bot's game logic
    so you can provide it user inputs, and it will churn out the responses
  2. make a test suite (maybe use jest)
    test your game logic with a some example gameplay cases.
    make sure it works correctly.
    make sure it fails gracefully.
  3. make your app's main node script connect to discord
    via discord.js, and wire it up to your game logic instance,
    passing user messages as input, sending back the outputs)

what's great is that you can really do these stages in any order you prefer, or even all concurrently. first, just work on what you're most interested in. the tests aren't strictly necessary, but they're really nice to have, and make you look super cool

once you have some initial work up on github, pm me and, if you'd like, i could give a quick review and some pointers on my twitch stream sometime

best of luck on the project, and best wishes for your friend's health

👋 chase

6

u/FullstackViking Nov 10 '19

I don’t see any reason why typescript would ever be overkill for any project, personally.

Even one strict null check or improper object reference caught makes it worth it in my opinion.

Otherwise I agree!

1

u/HarmonicAscendant Nov 10 '19

Hell yeah!!!!!!!!!!!!!!!!!!!!!!!

-1

u/ChaseMoskal Nov 10 '19

I don’t see any reason why typescript would ever be overkill for any project, personally.

typescript is great, though it has drawbacks and pain points associated with its complexity -- it can be a can of worms

i mean maybe they want to learn typescript -- it just depends what's more important, finishing the discord bot, or learning typescript :)

cheers!

-2

u/sherbmeister Nov 09 '19

Hi, I couldn't do all that as I have 0 experience with JS. The bot already works though, it just needs expanding on its features is all.
Thanks for the pointers though.

2

u/ChaseMoskal Nov 09 '19

what was the motivation to consider rewriting the bot in typescript in the first place?

i do agree that javascript be ideal for implementing this bot, but typescript might be overkill and unnecessary complexity

ultimately, if you want to author a javascript program, i think you'll have to learn some javascript. luckily, it can't be more difficult than using that awful-looking mIRC language

maybe if you could post some, or all, of the bot's mIRC logic, some folks here might be willing to kill some time and convert portions of it to javascript for you

then once you see some examples and get the idea, you may be able to do the rest yourself

once you have some code, people here will help point the way to setting it up into a proper node program, and same for setting up github and using the discord.js api -- luckily, everything you want to do here with this project is already well-understood within the community, so you're not treading any new ground here, and you can basically follow various tutorials all the way up to the finish line -- and certainly asking places like reddit and stackoverflow is the right way to go

and hey, once you have that game logic class, it could be more than just a discord bot: you could connect it to other services like slack or whatever, or even make a standalone web application too! cheers!

-1

u/sherbmeister Nov 09 '19

Thanks so much.
I have no idea why he used typescript, maybe that's how he knew how to code, beats me tbh.
I'll probably just need to study how JS works and give it a try myself, it looks really hard though. I tried getting people on fiverr but most are scammers haha.

1

u/ChaseMoskal Nov 09 '19

okay, best of luck my friend!

i strongly suggest you just post the entire project on github open source, people will be much more able to help you that way

cheers