Code Monkey home page Code Monkey logo

battlebot's Introduction

๐Ÿ’ซ About Me:

I <3 simple solutions

๐Ÿ’ป Tech Stack:

C C# HTML5 JavaScript PowerShell TypeScript Windows Terminal Azure Cloudflare GithubPages .Net Angular Blazor Bootstrap JWT NPM NodeJS Nginx MicrosoftSQLServer Postgres SQLite AZUREDEVOPS Docker SONARQUBE GIT Postman Raspberry Pi Swagger LINUX

battlebot's People

Contributors

greenfoot5 avatar q-sharp avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

xitraq

battlebot's Issues

Subscription ping issues

Describe the bug
While a pull request was opened, and the bot should ping everyone/here when it has permission, it doesn't.

To Reproduce
Steps to reproduce the behavior:

  1. Subscribe to a channel
  2. Send a message in the subscribed channel (not the subscriber)
  3. It won't ping everyone/here. Unsure on user pings.

Expected behavior
It should be pinging

Screenshots
If applicable, add screenshots to help explain your problem.

What platform are you using discord on?
Desktop and android. Both Canary but should be unaffected by this.

Additional context
Could be that only channel perms are checked, not server perms. The @everyone mention was also updated recently to also allow role pings.

Clans

Clans are a massive update to battle bot that brings a whole new set of commands to play with. It's already a wip, but now other areas need to be completed first. That's the json update #3 and options #6. I'll break it up a little.

  • Anyone can create a clan. - Anyone at all. However, may want to add a minimum level requirement for this so that people actually know what they're doing. Each clan will have an id, which is how they're indexed in the main json dict. A key issue here is linking clans however.
  • You can link the id of your BattleBot clan to your in-game clan. How this shall be done is currently unknown. One way would be to force people to their clan if when they create it along with clan name and tag. However, the other issue if verification. How can we confirm that their id is actually a correct id. Clanging ids could also mess up server links and profile links as well.
  • You can join a clan! Users can join a clan. This means that users can link a clan onto their profile and it also display's their clan tag before their username when possible (and if they haven't manually set it).
  • You can link a server and clan. This means that the server will be "linked" with the clan. For now, this just means that BattleBot will profile a few server details as well as an invite to the clan page. It will also automatically update the clan's icon if it hasn't been changed.
  • Allow users to edit their clan. This is from a range of stats already defined in clans.json
  • Allow users to promote/demote members according to the in-game ranks (but given better names).
  • Advertisements. Anyone can setup an advertisement channel. This would mean that channel receives advertisements from clans that have an advertisement setup, and it would do so a periodic intervals. It would also be nice to improve this system to filter out "bad" advertisements, but I'll make a separate issue for that.

Achievements

Currently, the only way to earn colours is by reach level milestones. Of which, 10 is the largest. It would be good to expand this system into something better. *Enter Achievements*

Achievements would replace the current colour system, but function much the same. You can still set your colours as before, but you earn new ones in different ways. This means level based colours can be further apart and also the achievements can be in a separate file instead of an add-on to the on_message command in cogs/profiles.py.

Some ideas on potential achievements:

  • Change something on your profile. (Use b!p set)
  • Join a clan/create a clan.
  • Level milestones (First few are fine, but after level 10, you could do every 25 levels starting at level 25.)
  • Get info on a server.
  • Join the support server.
  • Join a community server (So one that isn't linked to the clan)
  • Join the official discord (If BattleBot is ever added to the official discord)
  • Contribute to the bot. This could be through testing the dev version or writing code or even making a but report/feature request. This will likely be added manually.

Achievements would encourage users from the get-go not only with rp using the level-up notifications, but if the first colour earnt is done well (i.e. Not only telling them they got the colour, but also that they completed an achievement and also how to check the achievements). This then pushes people to explore and discover more about the bot if they want those colours.

Clans could also have achievements but the system would need to be developed fist (#7).

If there are any events using BattleBot, or other partnered servers, people could earn colours. Perhaps even if they make an edit on the wiki, but that's moving into dreaming.

Rank Points to Experience Points

Please describe what you'd like the bot to do
Rank points should be renamed to experience points. This is mostly in the profiles cog.

Why should the bot do this?
The name was changed in-game, and to avoid confusion, should also be changed on the bot.

Additional context
As per 8.0. Full discord patch notes here: Message Link

Remove colour listing

When someone uses the colour command, a message gets sent to the console listing their colours. Would be nice to reduce spam and turn this off.

Subscription edits and deletes

Please describe what you'd like the bot to do
When a message is deleted is edited from a subscription based channel, it should also be edited or deleted in the subscriber's channel. This means there aren't any silly typos or duplicated messages sent.

Why should the bot do this?
When a message is edited or deleted, it's usually because of some mistake, it would be good to make it so that those mistakes are less visable.

Additional context
Add any other context or screenshots about the feature request here.

JSON

All data saving should be changed to a readable format, json. It's not worth the effort at the moment to setup a database but I do need a better way of saving the data. I've decided to use JSON. This will mean changing all the current save method. This needs to be brought out before clans are reworked.

Announcement subscriptions

Verified servers have the option to create news channels. It would be great is BattleBot could be setup to do this. For example, servers could add a subscription to the official discord's announcement channels. This means people could be kept up to date on the latest changes and announcements. Including stuff about game night. The system should be developed to allow easy access to add more subscriptions. Such as Trello updates for the wiki/roadmap, wiki updates, Traplight social announcements, BattleBot updates and more.

Options

The current options command is old and outdated, hard to understand, and hard to use. I can't even remember how it works most of the time and I wrote it! It needs reworking. It wasn't compatible when I was working on clans, but it's even less so now with the json update.

In the rework, the options command needs to be simplified and as easy to use as possible. This could be a challenge to make it as simple as possible without making a custom interface with a dashboard, but it can certainly be better.

The current plan that I'm working on is to split the options down into the files that the option is for. So options relating to the user go into the profiles section, clans options into the clans file. I will then have to create a new servers file to allow options to be set but this would be good as I can then show some basic information about the server as well (like if it's linked to a clan or not and it's type). I could also in the future expand on sever types but for now I'll keep them at community or clan based. Clan would then just mean that the server is linked to a clan and show what clan it is in the server info embed. Nothing more.

User position on leaderboard

Describe the bug
Users not in the top 5 on the rp leaderboard will not show when the command is called. Users searched for will not show on the leaderboard either.

To Reproduce
Steps to reproduce the behavior:

  1. Use command "b!p lb @<user not in top 5>"
  2. Leaderboard of top 5 users will show

Expected behavior
Top 5 users and then rank about user searched for, the user and then the user ranked one below.

What platform are you using discord on?
Desktop application.

Mod-log improvements

Please describe what you'd like the bot to do
Include all attachment, system notifications and embeds on message deletes and edits.

Why should the bot do this?
Cause it gets missed and images that break server rules can't then be used as evidence.

Additional context
Subscriptions cog already does this, would be easily enough to implement, but it would be a good idea to spoiler all images.

Modlog Option set improvement

The yes/no value in the modlog option command for servers, is not needed. Just if the value is a channel, and if not, disable it.

Profile Searching

Currently, the way profiles are searched, it only allows people to search by discord username, not even nickname. It would be good to implement a search to search by the following in the following order:

  1. Profile Username. (Username in their profile, not discord username)
  2. Discord Username
  3. Discord Nickname

All valid profiles should be displayed and selectable. If there are more than 20 possible profiles, the bot should inform the user and ask them to be more specific.

Ping specific users

Please describe what you'd like the bot to do
The bot should be able to ping specific users when making an announcement/subscription message. It should just ignore everyone and here notifications.

Why should the bot do this?
Otherwise, user pings look really weird.

Additional context
This could be done using str.replace(@everyone, \@everyone) and the same with here to avoid here ping. This way the bot still stops announcers from pinging everyone and here by mistake, or users abusing it, but still allows individuals to be pinged for a special mention ect.

Improved Levels

Please describe what you'd like the bot to do
Have a better level system. With more features, better rewards and more.

Why should the bot do this?
The current rank system is very flat, and boring. Adding rewards, increasing the formula at later levels and a reset would help with this.

Additional context
Potential rewards:

  • Rank colours
  • Access to bonus commands
  • Extra customisation on their profile
  • Achievements
  • Access to clans

Larger Server RUM

Please descibe what you'd like the bot to do
The bot should be default disable RUM on larger servers over a certain amount.

Why should the bot do this?
RUM may be undesirable spam on larger servers, and if the bot is ever added to bot lists, it needs to be automatically disabled on those servers.

Additional context
Could use the library's function to see if the server is over the large amount, or use config.py to define what "large" means.

Improve README.md

I've left the readme in a barebones state. It needs more info about the bot, how to contribute and probably also some info about BattleLegion.

Clan Advertisement

As per #7, there will be a clan advertisement system that allows users to setup a channel that periodically sends advertisements for channels. This will be designed for community servers and it should take in several factors. Here are some of my ideas:

  • Activity. Is the clan active on discord? Looks at clan members as well as management.
  • Discord server. Does the clan have a discord server?
  • Ratings. What rating are the average rating of the clans? A range should be given where possible.
  • What language? This could require some extra info into the actual clans. Solve problems of people asking for a German clan, Brazilian clan ect. However, may have to just include countries.
  • How recent was the advertisement written? This one may be hard to do accurately as some go out of date, where others just don't need to change.
  • Do the clan actually want to advertise right now?
  • When was the advertisement last posted and where?
  • Admin Approval. This is where admins (of BattleBot) will "approve" advertisements. This means that advertisements will be "approved" and marked as SFW and marked for quality. This means that advertisements that are suitable will go through. This means that the bot can still operate on official servers that are SFW and any NSFW clans/advertisements or advertisements that are inappropriate can be removed/left alone. Only showing approved advertisements would be a default option and there will be the ability to enable/disable this feature on servers. The advertisement would be clearly marked as approved as well. Likely by an emoji after the clan name.

The advertisement system would also allow servers to filter advertisements as well as adjust the frequency of posting ect.

  • Ability to adjust frequency of the posts. So does the server want an advertisement every 30 mins, or just once a day?
  • Only allow discord servers. So, clans that have a discord server attached.
  • Rating requirements. Would allow people to filter posts, or setup multiple channels for each band. A range would be a good idea, upper and lower limit.
  • Cooldown on posts. This is dependent on actually tracking when the an advertisement was last sent to the server.
  • Admin Approval. This is explained above, and would be a default option.

Show profile settings

Currently, it's unclear to new users, exactly what values they can set with b!p set. It should display all valid options if they don't select one/on the help page.

UnboundLocalError: local variable 'destination' referenced before assignment

Ignoring exception in on_message
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "/home/greenfoot5/ftp/files/BattleBot-stable/cogs/profiles.py", line 400, in on_message
    await destination.send(f"Congrats {ctx.author.mention}! You've earned enough rank points to rank up to Rank {rank}!")
UnboundLocalError: local variable 'destination' referenced before assignment

Random Profiles error

Describe the bug
Stops users from selecting a random profile

To Reproduce
Steps to reproduce the behavior:

  1. Use b!p. Can be any profile
  2. Click on the random profiles reaction (the record reaction)
  3. Error should be displayed in chat.

Expected behavior
The embed is updated to a different, random profile.

What platform are you using discord on?
Android Canary. v11.1

Error Message

Ignoring exception in command profile:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 83, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/greenfoot5/ftp/files/BattleBot-stable/cogs/profiles.py", line 153, in profile
    colour = player.colour,
AttributeError: 'dict' object has no attribute 'colour'

Switching from json as filestorage to sqlite

Please describe what you'd like the bot to do
A clear and concise description of what the bot should do.

Why should the bot do this?
There are several things that could be developed, why should this feature be added?

Additional context
The exisitings data.loader interface will be a good help to change hole data access in one place without much work to do.

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.