Git Product home page Git Product logo

albion-discord-bot's Introduction

Albion Online Discord Assistant Bot

Code style: black License: GPL v3

This project is no longer being worked on.

Meet The Assistant

Thanks to the Albion Online Data Project, and the many players that download and run the Data Project client while playing the game, market price data are collected and shared freely with all Albion players. Perhaps the most popular tool that utilized these data is AlbionOnline2D.

The Discord bot fetches the latest minimum sell order prices (same as AlbionOnline2D), and plots the past 7 days historical prices, for the item that you asked. The assistant will find the closest match to your query and also provides item suggestions in case you forgot how to spell. What a sweet assistant.

How do I get the Assistant?

Host it yourself.

Features

emilie price <item name>
  • Returns latest minimum sell order prices as Discord embed, and plots 7 days historical prices. (First screenshot)
emilie quick <item name>
  • Same as previous command, but no plotting of 7 days historical prices (faster).
emilie search <option> <player/guild name>
emilie gold <number of days>

Admin commands (Only for self-hosted bots):

emilie extension <option> <cogs filenames>
  • <option> can be load, unload, reload.
  • Load/Unload/Reload cogs in the cogs folder, e.g. if you want to remove or add certain features.
emilie ping
  • Bot will return the latency.
emilie eval <python variables/generators>
emilie exec <python codes>
  • exec is the Python function exec.
  • This is a powerful command and care must be taken when using it.
  • This command allows you to run any Python code, thus it can be abused to spam or perform tasks that breaks the bot.
  • Screenshot: Finding the first 300 primes (I know this is arbitrary... but just to show you what it can do.)

The eval and the exec commands are there because I got tired of adding features to the bot.

I don't have to implement anything if I can simply run arbitrary codes.

- Famous last words before breaking everything

Hosting it yourself

Create a Discord bot account

  1. First go to Discord's developer portal.
  2. Create an application by clicking on New Application.
  3. Click on your newly created application, and on the left panel click on Bot.
  4. Build a bot by clicking on Add Bot.
  5. You have now created a bot account.

Run the Assistant as your bot account

  1. Download all the files in this repository, and the requirements. (Look at Requirements below)
  2. In your bot page in Discord's developer portal, copy the bot's TOKEN.
  3. Edit config.ini, and change botToken = abcdefghijklmnopqrstuvwxyz to botToken = your copied token. This is to tell the program to use your bot account.
  4. Open cmd or your terminal in the directory where you downloaded the files. Run python main.py.
  5. Your bot should now be hosted on your computer and you should see the message:
Logged in as Bot_Username#1234.
Connected to:

Invite your Assistant bot

  1. In your application page in Discord's developer portal, click on OAuth2.
  2. Under Scopes tick the bot box.
  3. Choose the Bot Permissions below as you like.
  4. Copy the link under Scopes once done, and open in your browser.
  5. Choose your server and go through annoying reCaptcha and you are done.
  6. Everytime you start the bot, the message will now say:
Logged in as Bot_Username#1234
Connected to:
Your server name

Configs

  1. Inside config.ini you can change or append:
adminUsers = 'username1#1234', 'username2#1234'
commandPrefix = 'emilie ', 'Emilie '
  • commandPrefix is how the bot should be called.
  • Being an admin user allows you to load/unload/reload cogs, and access utils.py commands.
  • The utils.py cog contain powerful commands that should only be callable by admin users.
  • Such commands can be abused to spam the server or to kick members. (Refer to Features below)
  1. You can also change:
debugChannelID = 12345678
workChannelID = 12345678, 12345678
debug = False
onlyWork = False
  • If debug is True, then the bot will send debug messages to the channel specified by debugChannelID.
  • If onlyWork is True, then bot will only work in channels specified by workChannelID.
  • Channel IDs can be obtained by first enabling developer mode in Discord under Settings>Appearance. Then right clicking on a channel and click on Copy ID.

Requirements

  • Python 3.6 or higher

  • discord.py

    • The bot is written with discord.py, an async API.
  • matplotlib

    • matplotlib is required to plot the 7 days historical prices.

    To install the required Python libraries, run the command:

    pip install discord.py matplotlib
    

    Or if you use conda:

    conda install matplotlib
    

Planned Features

  • Item data search to show recipes etc.
    • This is also possible but not implemented yet.
    • The item search API is already included in the the cog cogs/search.py, but nothing is done with it yet.

License

See the LICENSE file for license rights and limitations.

albion-discord-bot's People

Contributors

matchatealeaf 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

albion-discord-bot's Issues

item_data.json

Hello, first of all thank you for sharing this bot, it is really interesting and fun to play around with.

However, I have found one issue that I am not sure how to deal with: I have been noticing that the bot sometimes misses completely when searching for some items, such as the "Adept's Imbued Mace Head", and I realized that this item does not have the correct name in the item_data.json file.

The unique name is "T4_ARTEFACT_2H_MACE_MORGANA", the correct name should be "Adept's Imbued Mace Head", but in item_data.json it is named "Adept's Camlann Mace".

My question is, how was this item_data.json file generated? Can we somehow update/fix it automatically? The same issue happens with all of these "artefact" items, from what I can tell.

Sugestion

I'm posting as issue because i dont know where to post, but I have a sugestion.

Sugestion: Add a cmd to request price for all weapons of determined tier (for example, all 7.1 weapons) from blackmarket or even other cities

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.