Giter Site home page Giter Site logo

falcao-g / falbot Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 10.0 5.56 MB

Falbot is a fun open-source brazilian bot, with major focus in economy, featuring ranks, tons of fun games, user leaderboards and more!

Home Page: https://falbot.netlify.app/

License: GNU Affero General Public License v3.0

JavaScript 99.98% Shell 0.02%
bot discord-bot nodejs fun economy-bot discordjs discord-js discord open-source

falbot's People

Contributors

allcontributors[bot] avatar amarilhatiago avatar falcao-g avatar mateus-sposo avatar piyush-deshmukh avatar taciossbr avatar vinicius-marques6 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

Watchers

 avatar  avatar

falbot's Issues

mostrar items no /inventory equip

no momento é muito difícil saber quais items podem ser equipados e para que eles servem, para mitigar isso, esse subcomando deve receber um item opcionalmente

caso o item não seja passado como argumento pelo usuário, o comando deve retornar uma lista de todos os items que podem ser equipados com seus efeitos na frente

Roulette commands is using an inexistent message

Description of the bug

The /roulette command is trying to use the "ROLETA" message, but that message was renamed to "ROULETTE"

Steps to reproduce

Use the /roulette command

Media, if necessary

image

Dont use json

Please use dotenv files for important stuff like tokens, mongodb urls and apikeys. .env files are more secure than using normal jsons so please switch to them

Create an achievements system

Feature description

It would be cool to have a achievements system, in the bot, so we can encourage users to interact with a lot of systems and we can even grant rewards

How to implement?

We will need a new system that we can create achievements agaisnt and track when the users completed it,

we can also have a custom emoji for all achievements and make so the user can choose one to appear besides their user in /balance and ``/profile

Media, if applicable

No response

botões para o item anterior/posterior no /iteminfo

seria interessante colocar botões no /iteminfo como os da imagem abaixo, os quais, quando apertados, editassem a mensagem mostrando o item anterior/posterior de acordo com a lista de itens

isso ajudaria os usuários a descobrirem novos itens e suas funcionalidades

image

Create item that starts a random event

Feature description

Create a new mythical item that as a effect starts a random event

How to implement?

First we need to add the new item to the items.json (look at the eternal snowflake for reference), it would be cool if this new item recipe included unused items, like the octopus, the shark and some more

Then we need to update /inventory use, to add a test case to this new item and run a start a new random event, it would also be cool if we could keep track of who started it and reference this in the events section of the cooldowns command

Media, if applicable

No response

Criar um botão para iniciar a corrida e roleta russa

Descrição

No momento é criado um timer de 1 minuto ao utilizar esses comandos, nesse meio tempo, outras pessoas podem entrar, mas seria interessante criar um botão que a pessoa que criou a corrida ou a roleta pudesse apertar para cancelar o timer e começar naquele instante, assim caso todos os participantes já tenham entrado, não seria necessário ficar esperando o tempo acabar

Como implementar?

Basta criar um novo botão na mensagem, deixamos que só o criador da corrida/roleta o aperte, e, quando ele for apertado, o timer vai pra 0 e consequentemente o comando irá iniciar

Criar um comando de "exchange"

Descrição

Agora que temos um sistema de inventário consolidado e robusto, seria interessante criar um comando de troca, onde um usuário propõe uma troca para outro usuário e caso ele aceite, a troca acontece, por exemplo, eu ofereço para outro usuário 10 mil falcoins e 5 cordas por 5 diamantes

Como implementar?

Será a implementação básica de um comando, a parte mais complexa será processar todos os itens do input, recomendo indicar pro usuário que coloque a quantidade, depois o nome e separe ele com vírgulas, exemplo: "50m falcoins, 10 pedras, 5 cordas"

Make random events improve command's luck

Feature description

Right now the random events like comet, search party and such only multiplies the amount of items received, but it should also boost the chances of getting rarer items

How to implement?

No response

Media, if applicable

No response

/colapso com valores incorretos

Atualmente o comando /colapso (/crash) manda valores incorretos pois as contas são feitas com pontos flutuantes, exemplo:

image

Nesse caso o usuário apostou 10 mil falcoins, então o resultado esperado seria 6.000, mas aparece 5.999

Nome dos itens não são retornados

Descrição do problema

Quando o usuário usa um idioma do discord que não é português do brasil ou inglês dos estados unidos, o bot não retorna o nome dos itens, eles vem todos como undefined

Como reproduzir?

basta usar qualquer comando que envolva itens, como o /hunt, /fish, /explore etc

Mídia, se aplicável

image

Criar um método de criar embeds padrão

Descrição da sugestão

Sugiro um método padrão para criar embeds, assim não é necessário adicionar o mesmo footer e (quase) sempre a mesma cor toda vez

Como implementar?

Criar um novo método no index.js que cria e retorna uma embed, esse método precisa criar uma embed que tenha a cor definida com o getRoleColor e o footer padrão de todas as embeds, após isso temos que substituir todos os lugares que criam embeds por esse método

Mídia, se aplicável

não aplicável.

Create an item that protects your voteStreak

Feature description

Create an item that protects you from losing your voteStreak once

How to implement?

Create a new item that if it's equipped and the user is about to lose their voteStreak, the item gets used and the user doesn't lose the streak

this may mean we will need to rework the way that items are equipped

Media, if applicable

No response

Falcoins changes are inconsistent

Description of the bug

Because we only save the users document in the end of any command, if we use other commands while we have one ongoing, the falcoins changes will be inconsistent

To fix this we will need to create a new function that changes falcoins synchronously and find a way to continue reading the updated users document

Steps to reproduce

Use three or more slot commands for example and watch your balance fluctuate

Media, if necessary

No response

Lottery history pt-br description has a typo

Description of the bug

the description from /lottery history has a typo in Brazilian Portuguese, it should read "ganhadores"

Steps to reproduce

try to use /lottery history in Brazilian Portuguese and read the description

Media, if necessary

image

Make /inventory sell autocomplete not show mythical items

Description of the bug

Mythical items can't be sold, so they should not appear in the inventory sell autocomplete

Steps to reproduce

Use /inventory sell and check the autocomplete, the eternal snowflake appears there, but the snowflake is a mythical item

Media, if necessary

No response

Mudar o sistema de idioma

Descrição

No momento temos no bot um sistema de idioma que não diferencia entre servidor e usuário, então muitas vezes se faz uma gambiarra pra ele funcionar em qualquer um dos casos, isso não é ideal, esse sistema precisa ser mais robusto, sabendo diferenciar se você está querendo pegar o idioma de um servidor ou um usuário e priorizando a escolha do usuário caso ele já tenha configurado seu idioma

Como implementar

Criar campos de idioma nas schemas de usuário e servidor, mudar os métodos de get e set e adaptar o comando /idioma

Criar um sitema de desativar comandos

Descrição

Para aumentar a acessibilidade e facilidade de configuração do bot seria interessante criar um novo sistema de desativar comandos, ele funcionaria de forma análoga ao desativar canais, os moderadores de um servidor podem desativar um comando e o bot não irá responder aquele comando naquele servidor

Como implementar?

Como o funcionamento é parecido com o sistema de desativar canais, a implementação seria semelhante também, basta adicionar um novo campo para o guildSchema, um novo comando só para moderadores poderem desativar/reativar comandos e uma checagem antes de executar cada comando para ver se eles não foram desativados

Mudar a ordenação do inventário

Descrição

Quando você pede pro bot te mostrar o inventário, os itens são mostrados na ordem que o bot achou no banco de dados, seria legal poder configurar o tipo de ordenação do seu inventário, para mostrar primeiro, por exemplo, os itens mais valiosos ou os que você tem em maior quantidade

Como implementar?

Não tenho 100% de certeza, talvez um sort personalizado do javascript seja suficiente

Missing item emoji in item leaderboard

Description of the bug

when we sort the users by item in the embed description the emoji item is missing

Steps to reproduce

just use /leaderboard item with any item

Media, if necessary

image

Quanto devem valer os items que são construídos?

Descrição

No momento temos 3 categorias de itens que são construídos levando em conta seus valores, temos os itens que valem menos que a soma do valor de seus ingredientes, como por exemplo a panqueca que vale 800 e seus ingredientes valem 4800, temos os que valem exatamente o mesmo, como as ferramentas, e temos itens que valem mais que a soma de seus ingredientes, como a bola, que vale 23.900 e seus ingredientes valem 20.400

Imagino que os itens que só servem para serem vendidos, deveriam valer, pelo menos, a soma do valor de seus ingredientes, e os itens que realmente tem uma funcionalidade, devem valer mais que isso, por exemplo a picareta de ferro que serve para ser equipada e ganhar mais itens, ela deveria valer mais que a soma de seus ingredientes?

gostaria de ajuda nessa dúvida

Make it so we can reload a single event/command

Feature description

Right now we can either reload all commands, or all events, but normally we only want to reload a single command/event

How to implement?

The /tools command only calls the loadEvents and loadCommands function, and these two functions just rewrite all commands and events, so this causes them to be reloaded, if we wrote new functions that only reloaded a single command/event we could call those

Media, if applicable

No response

Create messages/items sub-files

Feature description

Currently, all messages/items are stored in a single big JSON, wich is hard to find where a specified message or item is. The ideia is to classify each message/item according to their common traits.

How to implement?

No response

Media, if applicable

No response

Menu de contruir tem que receber entre 1 e 25 items

Descrição

Ao usar o comando /inventário construir sem passar nenhum item, o usuário recebe um menu mostrando todos os itens que ele pode construir, porém, temos um problema, se dito usuário não puder construir nenhum item (ou mais de 25 deles), o discord vai levantar um erro, pois o menu de seleção só pode receber entre 1 e 25 itens, isso precisa ser consertado

Como consertar?

Existe um pedaço de código nesse subcomando que calcula quais e quantos items o usuário pode construir e adiciona como opções no menu, precisamos garantir que são entre 1 e 25, se for 0 opções podemos informar ao usuário que ele precisa de mais itens para poder construir algo, e se forem mais de 25, precisamos deixar só as 25 primeiras

Create a market system

Feature description

Add a market system to falbot, where users can list their items for sale and people from all servers can see/buy it, or they can list buying orders in the market, so when others players sell that item using /inventory sell, the item is also sold to whatever player wants it

the subcommands should be:

  • /market all: a paginated menu that shows all items and if there are listings for it
  • /market view: get a page of a specific item and shows the sell/buy listings
  • /market buy: buy item from the market
  • /market delist: remove a listing you made
  • /market listbuy: create a listing to buy a item
  • /market listsell: create a listing to sell a item
  • /market listing: see all your listings
  • /market sell: sell a item to the market

also we need to add a new field to the /iteminfo command if there is a listing to sell that item, telling the player for how much he can buy it for

and the /inventory sell will need to check if there are people wanting to buy that item and sell it to them

How to implement?

I think this is more of a database challenge, we will need a new table for listings, the listing needs to have a id, owner, items related to it, type (buy/sell/ and falcoins, so when the user uses the commands we can just crunch the information and send it to them

Media, if applicable

image

Stats system

Feature description

It would be really cool if we had a stats system, something that kept track of certain actions of the player and the player could view it in a /stats command, some ideas of stats: times worked, times mined, times fished, times explored, times hunted, how many rankups, total items found, total times voted, top vote streak and total commands used

in the future this stats could be useful for a achievements system as well

How to implement?

I think a smart thing to do would be to create a new schema for stats, that has the _id equals to the discord id and a lot of fields, each for a stat, then we could update each one and just feed that to the command

the boring part will be to call a function updating the stats in each relevant part, but oh well

Media, if applicable

No response

Transpile Falbot to Typescript

Feature description

Transcribing Falbot into Typescript can be a big challenge, but through this process it will be possible to review the entire code, allowing you to improve various parts and make the bot more modern and readable.

Currently, many objects used in commands don't have any indication of their properties and methods, and are only of the "any" type.

How to implement?

Refactor time!

Media, if applicable

No response

Add a "no-legendary" option in /inventory sellall

Feature description

The previous behavior of the /inventory sellall command was to sell all items but the legendary ones, now it sells all items but the mythical ones, this created some confusion with players that were used to the old behavior

To fix this, and because this will most likely be what basically everyone wants to do, add a "no-legendary" option in the command, if this is set to true, then the bot will also not sell the legendary items

How to implement?

Just implement a new argument with two options "true" and "false", the default should be true, if it's true we check if the item is a legendary one and skip it

Media, if applicable

No response

Let the user that started a competitive command cancel it

Feature description

right now if a user starts a horseduel, a russianroulette, a fight or a tic tac toe, they are stuck with it and can't change their minds, add a way that those users can cancel it

How to implement?

In fight and tic tac toe that's easy, just let the refuse button also listen if the user who started it press it

horseduel and russianroulette will need a new button for cancelling

Media, if applicable

No response

Tradução para espanhol

Descrição

Como o Falbot é um bot brasileiro, e agora temos um sistema mais robusto de mensagens, está na hora de implementarmos mais idiomas nele, assim, o espanhol é um ótimo para começar

Como implementar?

Para todas as mensagens no messages.json, e para todos os itens no items.json, precisamos colocar um novo campo -> "es-ES": "texto-em-espanhol" 😃

Acumular a loteria se ninguém ganhar

Descrição

No momento, se ninguém comprar bilhete para a loteria, ela só termina sem nenhum ganhador, uma solução seria acumular o prêmio dessa loteria com o da próxima e colocar no histórico algo como "não houve ganhador e o prêmio de x falcoins foi acumulado"

Como implementar?

Basta ir no evento lotteryDraw no index.js do bot, e checar se teve algum ganhador, caso contrário faça as ações descritas acima

Farming system

Feature description

It would be really cool to implement a farming system,

Players would have a N number of plots in their farms (this can increase with their rank), they can see their farm with /farm view, plant crops with /farm plant, remove growing crops (without collecting them) with /farm uproot and harvest them with /farm harvest

Also we can make a watering system, players can water the plants each hour to remove the growing time of them by 45m, and if they don't water them in 30 hours, the plants die

How to implement?

All farmable items do not exist yet, (besides the clover and weeds), and need to be added. we can add blueberry, strawberry, kiwi, coconut, mango, melon, pumpkin, wheat and potato, they also will each have a different growing time and yield, which the item will need to know itself (a new attribute for each of the in the json)

Apart from that it's going to be similar to the inventory system, most of the logic will be in a single command file with a lot of subcoomand, but i think it's good to make a new table in the db with the farms, instead of a new field in the player one

Media, if applicable

the farm can look something like this:

image

Add sharding

Feature description

Add bot sharding to Falbot, so that we don't need to do this later

How to implement?

I think this should be easy, the things that will need to be thought are both the getting custom emojis and the botinfo, because when we have separate shards only one shard will have access to the servers where the emojis are and the servers will also be split between then

discord.js guide section that talks about this: https://discordjs.guide/sharding/#how-does-sharding-work

other bot that uses sharding: https://github.com/Ayushselfcoder/Gamify/blob/main/shards.js

Media, if applicable

No response

Add enviroment variables documentation

Feature description

Add a .env.example file so it's easier for people to understand what needs to be filled

How to implement?

No response

Media, if applicable

No response

Leaderboard item autocomplete not working

Description of the bug

The autocomplete from /leaderboard item is not working,

that is because the bot analyzes with .startsWith() and all items start with emojis, so you can just search with emojis, this issue is fixed in the /inventory commands so we can just copy the code from there

Steps to reproduce

use /leaderboard item and try to get the bot to autocomplete any item

Media, if necessary

image

Sugestão automática de itens

Descrição

No momento, temos vários comandos que recebem um item como argumento, portanto, seria mais eficiente usarmos um autocomplete similar ao do comando math para irmos sugerindo para o usuário qual item ele deseja escrever, isso ajudaria até a definir quais itens alguns comandos como o construir e o equipar podem receber, já que os usuários só conseguem mandar o que está aparecendo no autocomplete, então no construir sugerimos só itens que podem ser construídos e no equipar sugerimos só itens que podem ser equipados

Como implementar?

Temos que olhar o código do comando math e analisar como ele lida com o autocomplete, mas claro que precisamos pegar os itens que são relevantes para aquele comando, analisar o que o usuário está digitando e sugerir um item, usando .startsWith() e .toLowerCase() muito provavelmente

Improve pagination function

Feature description

At the moment we have a pretty good paginate function that works well, but I wanted to be possible to put more than embeds in the paginate system, so that we could paginate alongside the embed a string select menu for example

How to implement?

No response

Media, if applicable

No response

Incorrect bonus percentage in /vote text

Description of the bug

The bot is not limiting the maximum bonus percentage text that can be earned on /vote

Steps to reproduce

Use /vote until the text shows a percentage above the 150% threshold

Media, if necessary

image
image

/perfil como context menu

seria interessante criar um comando context menu para o /perfil, assim como temos o Ver perfil do usuário que é um context menu do comando /conta

leaderboard item sort error

Description of the bug

the /leaderboard item has a issue when the user sends a item name valid but different from the item key in the items.jsom, to fix this we need to first get the item key using getItem() and afterwards verify that the key is valid (!== undefined)and finally send the query with the item key given

Steps to reproduce

use /leaderboard item and input im the item field "pedra" for example, falbot executes the command because pedra is a valid item (rock), but it sends the query to mongodb with the text the user gave it

Media, if necessary

No response

É possível "farmar" vitórias

Descrição

Caso o usuário faça roleta russas e corridas e jogue sozinho, seu dinheiro permanece o mesmo, mas as vitórias aumentam

Como consertar?

No final desses comandos, será necessário analisar se tinha mais de um usuário jogando, antes de dar uma vitória pro vencedor

Random events system

Feature description

In the cooldowns command, we have a events field, nowadays there is only the lottery in there, but i want to make a "random events" system, aka, a system where there is a random chance of a event happening, this event can for example, increase 2x the items when fishing, or other item command, or something that increased the falcoins won in some other place

How to implement?

This is mostly a backend challenge, the only thing the user will see will be a message in the events section with the event name and when it ends, the rest is all going to be backend, some function that runs each X time and determines if there is going to be a event or not, and a piece of code in each relevant command to see if there is a event active

Also it's good to have a new subcommand on /tools that makes possible to the owner of the bot to start events with a personalized name/emoji

Media, if applicable

An example of events names, effects and how it would look like to the user

image

mostrar items que podem ser construídos no /inventory craft

atualmente, não tem um jeito de o usuário saber quais itens ele pode construir com seu inventário atual, uma solução para isso seria deixar o argumento item do /inventory craft opcional, e, caso o usuário não passe um item, o bot mande uma mensagem com um menu (como o da imagem abaixo), mostrando todos os itens que podem ser construídos no momento

image

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.