Giter Site home page Giter Site logo

the-hideout / stash Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 14.0 1.33 MB

The Tarkov.dev's Escape from Tarkov Discord bot

Home Page: https://discord.com/api/oauth2/authorize?client_id=955521336904667227&permissions=309237664832&scope=bot%20applications.commands

License: GNU General Public License v3.0

Dockerfile 0.17% JavaScript 99.83%
chat bot discord escape-from-tarkov

stash's Introduction

Stash ๐Ÿค–

ci deploy CodeQL Discord

Stash is a Discord bot that helps you play Escape from Tarkov!

This is the official Tarkov.dev Discord bot.

To add the bot to your server, just click the link below:

Invite Stash ๐Ÿ”—

About ๐Ÿ’ก

This bot takes all the data from Tarkov.dev and exposes it in a user-friendly way.

This bot is open source and supported by the team behind Tarkov.dev.

Commands ๐Ÿ’ฌ

Command Example Description
/help /help or help <command> The help command to view all available commands
/price /price name: <item> Get a detailed output on the price of an item, its price tier, and more!
/map /map woods View a map and some general info about it
/barter /barter name: <item> Check barter details for an item
/craft /craft name: <item> Check crafting details for an item
/ammo /ammo ammo_type: 5.45x39mm Get a sorted ammo table for a certain ammo type
/status - Get the game/server/website status of Escape from Tarkov
/about - View details about the bot
/issue /issue message: <text> Report an issue with the bot
/invite - Get a Discord invite link for the bot to join it to another server
/tier - Show the criteria for loot tiers
/changes - Get the latest game changes from tarkov-changes.com
/patchnotes - Get the latest official patchnotes for EFT
/stim - Get information about a in-game stim
/roulette - Play a game of roulette to determine how you play your next raid
/uptime - Get the bot's uptime

Development ๐Ÿ”จ

For development you need to create two files in your local directory, one is for registering commands and the other one is for running the bot.

The files are:

  • config-dev.json
  • .env

Create a Discord Bot

Before you can test the bot locally, you will need to create a Discord bot.

Create your bot:

create bot

The config-dev.json file

An example of the config-dev.json file can be found at the root of this repo at config-dev.example.json. You will need to edit and rename this file to config-dev.json and add the appropriate values as seen below:

{
    "clientId": "<add_value_here>",
    "guildId": "<add_value_here>",
    "token": "<add_value_here>"
}

clientId

The clientId can be found in your Discord bot's general information under APPLICATION_ID.

client id

guildId

Copy the guildId from the Discord server you want to add the bot to:

guild id

Note: In order to copy a guildId, you will need to have Discord developer mode enabled, scroll down in the guide to see how to do so (it's easy!)

token

The token is the same as the DISCORD_API_TOKEN which can be found in the .env setup steps below.

The .env file

Next, you will need to edit the .env file and add the appropriate values as seen below:

DISCORD_API_TOKEN=<value_here>
ADMIN_ID=<value_here>
NODE_ENV=development

The DISCORD_API_TOKEN can be found here:

token

ADMIN_ID is your personal Discord user ID, which is used for admin commands and can be found here:

admin id

To add the DEV bot to your server, click this link where you've replaced the <MY_CLIENT_ID> with your bots application id:

https://discord.com/api/oauth2/authorize?client_id=<MY_CLIENT_ID>&permissions=309237664832&scope=bot%20applications.commands

How to Enable Developer Mode

In order to copy certain values (such as channel/guild/user IDs), you need to enable developer mode in the Discord client:

  1. In Discord, open your User Settings by clicking the Settings Cog next to your user name on the bottom.
  2. Go to Appearance and enable Developer Mode under the Advanced section, then close User Settings.
  3. Open your Discord server, right-click on the server name, then select Copy ID (to obtain the "guild ID" of your Discord server).

Starting the Bot ๐Ÿš€

Before you start the bot, you will need to register the Slash commands in your test server:

$ npm run dev-commands
Successfully registered application commands.

Next, there are two ways to start the bot:

  • Locally (suggested)
  • Docker

Locally

To start the bot locally, run the following commands:

$ npm run dev
Filling autocomplete cache
fill-autocomplete-cache: 590.582ms
Logged in as stash-dev#1234!

Docker

To start the bot with Docker, simply run the following command:

$ docker-compose up --build
Creating bot ... done
Attaching to bot
bot    | Setting up rollbar
bot    | Filling autocomplete cache
bot    | fill-autocomplete-cache: 944.249ms
bot    | Logged in as stash-dev#1234!

Roulette ๐ŸŽฒ

Want to add a new item to the roulette?

Simply edit the following JSON file to add your entry!

roulette.json

Deployment ๐Ÿš€

Deploying the bot is very easy! Just do the following:

  1. Write the code for your changes
  2. Open a pull request
  3. Get a review and ensure CI is passing
  4. Comment .deploy on your pull request to deploy your changes to production

Test your changes in production before merging! If anything goes wrong, type .deploy main to revert your changes

Once your PR has been deployed and everything looks okay, merge away!

stash's People

Contributors

austinhodak avatar center-deal avatar dependabot[bot] avatar difficultphil avatar evanblaine avatar faalagorn avatar froggi22 avatar github-actions[bot] avatar grantbirki avatar kokarn avatar mahzze avatar marvhh avatar miguelmachado-dev avatar oskarrisberg avatar razzmatazzz avatar shebuka avatar thaddeus avatar the-hideout-combine-prs[bot] avatar zubrowfr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stash's Issues

`/ammo` command doesn't use `ammo_type`

After typing /ammo, name is the only reported option and is forcibly used, which will filter to only that specific ammo and not the generic class of ammo like is shown in the docs (/ammo ammo_type: 5.45x39mm). The /help command shows name, but like the docs here uses the ammo type and not the specific round name, which is inconsistent with the actual command.

Translations Needed

We've incorporated localization into the bot, but now we need help translating it! The translations are stored in json files. If there's a mistake in a translation, you can edit the corresponding translation file with corrections and submit a PR. If a translation is missing for a language in which you are fluent, you can start with the English file and change the translation values into that language.

The translation files are split into two namepaces. The first translation namespace is where the text from the bot's command responses is stored. The command namespace is where the text for the bot's slash commands is stored. In this namespace, any key that doesn't end in _desc is a command or argument name that can only contain letters, numbers, and underscores.

Below is the status of the different language translations:

  • cs: not started
  • de: finished by @marvhh
  • en: finished
  • es: finished by @Center-Deal
  • fr: finished by @ZubrowFR
  • hu: not started
  • it: not started
  • ja: not started
  • ko: not started
  • pl: not started
  • pt: finished by @mahzze
  • ru: In progress by @DifficultPhil
  • sk: not started (note: not currently supported by Discord)
  • tr: not started
  • zh: not started

These are the languages currently supported by the API. Discord supports some additional languages too, and we also welcome those translations!

User progress and trader restock alerts are broken

With the required move to sharding, user progress is not saved/updated properly and too many trader restock alerts are being sent out. I've started a fix at #79 , but it's throwing strange DiscordAPIErrors that make no sense to me.

Possible way to track recent updates & Patchnotes.

It would be great to be able to use an command like "update", or "patchnotes" to be able to see the most recent patchnotes. Maybe you could take them from BSGs twitter if you can sift through the tournament announcements.

Thanks so much for your work once again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.