Coder Social home page Coder Social logo

staciax / valorant-discordbot Goto Github PK

View Code? Open in Web Editor NEW
331.0 15.0 206.0 741 KB

A discord bot with valorant api.

License: GNU General Public License v3.0

Python 99.54% Procfile 0.01% Batchfile 0.07% Dockerfile 0.11% Nix 0.26%
api valorant discord valorant-api discord-bot python bot discord-py discordapp dpy

valorant-discordbot's Introduction



Valorant Discord Bot

Store, Nightmarket, Battlepass, Missions, Bundle, Notify

Support Server release discord.py License

AboutInstallationScreenshotsUsageTranslationsDisclaimerSpecial ThanksSupport

Note ⚠️

  • will not receive updates until v4.0.0 will be finished. sorry 😭
  • I'm a student and I have to divide my study time with this project.

About

Discord bot that shows your information and more without opening VALORANT by using the In-game API. written using Python and the Discord.py library
If you need help regarding Valorant Discord Bot, please join the support server

Heroku

Important: Please note that dynos will have be restarted every 24 hours. All changes to the local filesystem will be deleted, which means you'll have to relogin using /login once the 24-hour limit is reached. Read more about automatic dyno restarts here.

Deploy

Repl.it

Important: All projects under the Repl.it free plan are public. To solve the privacy problem, all data is stored in the Repl.it Database, but the Repl.it Database is slow to read and it takes time to execute commands. (Cache system to be updated)

Run on Repl.it

P.S. need to add 2 secrets: TOKEN and OWNER_ID, need to use Uptimerobot or other services to keep the bot alive.

Docker

To simply install the latest stable version, run

docker pull marchingon12/valorant-bot

If using Docker Desktop (GUI), run using environmental variables under "Optional Settings". Put in your TOKEN and OWNER_ID.

If using Docker-CLI, you have to manually put in your env vars in a single line like this:

docker run -e TOKEN=<YOUR_BOT_TOKEN> -e OWNER_ID=<YOUR_OWNER_ID> marchingon12/valorant-bot

or use --env-file to point to the path you stored your env file. Read more info on how to do so here.

View on Docker image on DockerHub.

Screenshots

image image

See more screenshots battlepass nightmarket missions points

Installation

pip install -r requirements.txt
  • Store discord bot token and owner ID under .env
TOKEN='INPUT DISCORD TOKEN HERE'
OWNER_ID='INPUT YOUR DISCORD ID'
  • How to get your Owner ID

    1. Turn on Developer Mode under Discord Settings > Advanced

    2. Right click on your profile icon in any chat and copy your ID

  • Run the bot
python bot.py
  • the Slash Command (/) will automaticalled be assigned for global commands (global commands can also take up to an hour to update for Android users). Refer to docs.
  • to use commands in your server immediately, use -sync guild.
  • remove commands in your server by using -unsync guild.
  • remove global commands by using -unsync global. This removes commands for everyone using the bot.

Important: custom emojis used by the bot will be added to your server so that they can be accessed when needed. If there are no slots left, emojis will not be added and therefore displayed in text from e.g. :ValorantPointIcon:. There are 7 custom emojis in total.

Usage

Command Action
/store Shows your daily store
/point Shows your valorant point
/login Log in with your Riot account
/logout Log out of your Riot account
/misson View your daily/weekly mission progress
/nightmarket Shows your nightmarket
/battlepass View your battlepass' current tier
/bundle inspect a specific bundle credit by Giorgio
/bundles Show the current featured bundles credit by Giorgio
/cookies Login to your account with a cookie, How to cookies credit by Giorgio, video
/notify add Set a notification when a specific skin is available on your store
/notify list View skins you have set a notification for
/notify mode Change notification mode Specified skin or all skin
/notify test Testing notification
/notify channel Change notification channel DM Message or Channel(in server)
/debug command for debug emoji, skin price,cache is not loaded

Translations

If you want to use your language and would like help translate the bot, please do!

  • Option 1
  1. You can translate my crowdin project here.
  1. Fork the repo
  2. Look up the language code for your language here
  3. In the languages folder of your forked repo, copy en-US.json and rename it to your language code
  4. Open that file and do the thing
  5. Open a pull request
  • Alternatively, you can just send me the JSON on discord and I'll upload it for you.

License

This project is licensed under the GNUv3 License - see the LICENSE file for details.

Disclaimer

Please read the DISCLAIMER before using the code to host your bot.

Valorant-DiscordBot is not endorsed by Riot Games and does not reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games and all associated properties are trademarks or registered trademarks of Riot Games, Inc.

Special Thanks

This project wouldn't have happened without.

Support Me

ko-fi

valorant-discordbot's People

Contributors

0120-500-500 avatar c7e715d1b04b17683718fb1e8944cc28 avatar hackante avatar kiznick avatar kohanasann avatar marchingon12 avatar mayonejy avatar miigo-dev avatar miigoxyz avatar mstww avatar mzfan avatar overestimate avatar r3nzthecodegod avatar rahmanatmja avatar ryugaxhyper avatar salomonj11 avatar scarrrr316 avatar sevzin avatar staciax avatar tmadz2007 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  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  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  avatar  avatar  avatar  avatar

Watchers

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

valorant-discordbot's Issues

login issue

when i tried the /login it shows an error: Expecting value: line 1 column 1 (char 0)
Capture

Everyday it logs me out

each time I come back to the bot to type /store im logged out again even though I never typed logout

403 Forbidden Error 50001

When running the bot, non essential error 403 code 50001 occurs.

All packages inside of requirements are installed, the bot has admin privlages, can send commands, and the sever if/channel id are correct, the TOKEN is correct, the val account is correctly listed with correct syntax.

The error is raised by discord for missing access.

This occurs on the latest clone and the current release.

what happened?

image

it always like this when i tried to login, other command works perfectly by asking me to login, but when i tried to login it always error like this

Factor Authentication Issues

My friend has some issues that he cannot login because he uses FA, can u help me and tell me where should he put the code for 2FA?
Screen Shot 2022-03-18 at 14 11 15

Update replit branch

Staciax. You bot is encredible...

Im levaving a suggestion
Can you port the last update to the replit branch?

Thanks

How do the notifications work?

Hello, I wanted to ask about how the notifications of skins goes because every time I try to put a notification I get 'NoneType' object has no attribute 'emojis', then I would like to know how to notify you about a skin. Sorry for the inconvenience

Auth Error

Host: Heroku
Python: 3.8.5
Code Ver: 1.0.1 ( latest update )
Console no error
image

Login Command: decode JSON failed

Using the login command results in an error.
image
changing the code in
https://github.com/staciax/Valorant-DiscordBot/blob/c76f330f2d3d1dc691330e542dab056fc3122dd2/utils/valorant/auth.py#L97 to disable the content_type check to r.json(content_type=None) reveals that the response of the riot games api to https://auth.riotgames.com/api/v1/authorization is returning a 403.
I don't know what your source is but the same issue is mentioned here but the suggest fix doesn't work for me.
I also found this which might be helpful.

error

freeze and no updates.

image

valorantstore bot no setting up

image
the bot couldn't setup, its stuck on "setting up..." waited for 30 minutes and still no sign of "setup in guild!"
P.S. am a beginner

Error using pterodactyl

Task exception was never retrieved
future: <Task finished name='CommandTree-invoker' coro=<CommandTree._from_interaction.<locals>.wrapper() done, defined at /home/container/.local/lib/python3.8/site-packages/discord/app_commands/tree.py:996> exception=TypeError('Subscripted generics cannot be used with class and instance checks')>
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.8/site-packages/discord/app_commands/commands.py", line 655, in _do_call
    return await self._callback(self.binding, interaction, **params)  # type: ignore
  File "/home/container/cogs/valorant.py", line 91, in login
    authenticate = await auth.authenticate(username, password)
  File "/home/container/utils/valorant/auth.py", line 122, in authenticate
    data = await r.json()
  File "/home/container/.local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://auth.riotgames.com/api/v1/authorization')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.8/site-packages/discord/app_commands/tree.py", line 1168, in call
    await command._invoke_with_namespace(interaction, namespace)
  File "/home/container/.local/lib/python3.8/site-packages/discord/app_commands/commands.py", line 681, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/home/container/.local/lib/python3.8/site-packages/discord/app_commands/commands.py", line 674, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'login' raised an exception: ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://auth.riotgames.com/api/v1/authorization')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.8/site-packages/discord/app_commands/tree.py", line 998, in wrapper
    await self.call(interaction)
  File "/home/container/.local/lib/python3.8/site-packages/discord/app_commands/tree.py", line 1171, in call
    await self.on_error(interaction, e)
  File "/home/container/cogs/errors.py", line 47, in on_app_command_error
    elif isinstance(error, Union[AppCommandNotFound, MissingPermissions, BotMissingPermissions]):
  File "/usr/local/lib/python3.8/typing.py", line 769, in __instancecheck__
    return self.__subclasscheck__(type(obj))
  File "/usr/local/lib/python3.8/typing.py", line 777, in __subclasscheck__
    raise TypeError("Subscripted generics cannot be used with"
TypeError: Subscripted generics cannot be used with class and instance checks
Unclosed client session
client_session: <utils.valorant.auth.ClientSession object at 0x7f131194ac70>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f1311c3d9a0>, 229498.274342278)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f131194a880>

account hacked.

a friend told me his account's name and pass got changed
I asked him if he had 2fa enabled
and he said he did
but he also used /2fa command
I'm not sure if it's related to the bot or not
but his acc was Immortal 3 and had lots of skins

Can't load emoji

Bot didn;t load emoji
บอทไม่โหลด emoji ครับ

ไม่สามารถสร้างอีโมจิได้ กรุณาลองอีกครรั้ง
ไม่สามารถสร้างอีโมจิได้ กรุณาลองอีกครรั้ง
ไม่สามารถสร้างอีโมจิได้ กรุณาลองอีกครรั้ง
ไม่สามารถสร้างอีโมจิได้ กรุณาลองอีกครรั้ง
ไม่สามารถสร้างอีโมจิได้ กรุณาลองอีกครรั้ง
ไม่สามารถสร้างอีโมจิได้ กรุณาลองอีกครรั้ง
ไม่สามารถสร้างอีโมจิได้ กรุณาลองอีกครรั้ง
Response Status: 200
image_2022-04-30_182949427

/point "None #"

Screen Shot 2022-05-23 at 11 39 16 AM

whenever i use the /point command, it prints "None" followed by the number.

also, all the commands work when i use this bot in a server that i'm only in, but /point and /bundle doesn't work in a server of 50+ people. it just keeps saying "thinking" and never loads. i use heroku free version to host this bot so could it be that since i'm using a free version, it takes more traffic? do you have any free or cheap bot hosting recommendations?

Screen Shot 2022-05-23 at 11 41 39 AM

API status 403

I think riot updated their api, i got some 403 error when trying to login

error when using /login command

C:\Users\user\Downloads\Valorant-DiscordBot-master>python bot.py
Checking new store skins for notifys...
Fetching Valorant version !

Logged in as: VALORANT#5304

 BOT IS READY !
Version: 3.2.1
Task exception was never retrieved
future: <Task finished name='CommandTree-invoker' coro=<CommandTree._from_interaction.<locals>.wrapper() done, defined at C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\tree.py:996> exception=ValueError('Both or neither of value and tb must be given')>
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1089, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1119, in _create_connection_transport
    await waiter
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 534, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\asyncio\sslproto.py", line 188, in feed_ssldata
    self._sslobj.do_handshake()
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 975, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 655, in _do_call
    return await self._callback(self.binding, interaction, **params)  # type: ignore
  File "C:\Users\user\Downloads\Valorant-DiscordBot-master\cogs\valorant.py", line 91, in login
    authenticate = await auth.authenticate(username, password)
  File "C:\Users\user\Downloads\Valorant-DiscordBot-master\utils\valorant\auth.py", line 111, in authenticate
    r = await session.post('https://auth.riotgames.com/api/v1/authorization', json=data, headers=self._headers)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 535, in _request
    conn = await self._connector.connect(
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 988, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host auth.riotgames.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\tree.py", line 1168, in call
    await command._invoke_with_namespace(interaction, namespace)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 681, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 674, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'login' raised an exception: ClientConnectorCertificateError: Cannot connect to host auth.riotgames.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\tree.py", line 998, in wrapper
    await self.call(interaction)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\tree.py", line 1171, in call
    await self.on_error(interaction, e)
  File "C:\Users\user\Downloads\Valorant-DiscordBot-master\cogs\errors.py", line 51, in on_app_command_error
    traceback.print_exception(type(error), error)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\traceback.py", line 116, in print_exception
    value, tb = _parse_value_tb(exc, value, tb)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\traceback.py", line 95, in _parse_value_tb
    raise ValueError("Both or neither of value and tb must be given")
ValueError: Both or neither of value and tb must be given

Failed to add to my server

hi sir, i failed add this discord bot to my server, i've follow the instructions, and when i run it, here's what appear:

image

/store error

Screenshot_20220518-183440.png

Even after logging in, when I try to use the /store command the next day, I am asked to log in again!

error

I don't know how to solve this problem.
image

SUGGESTION: Use riot web Page login

Im dropping a suggestion here:

I was thinking about that you could improve the login system by replacing the login parameters in /login command with a link that sends the bot wich redirects you to the riot games login page to login into the bot.

It would be amazing if you did that thing.

This is only an idea

Thanks.
Miguel

Missing Access HOW TO FIX?

Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\USER-PC\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 382, in _run_event await coro(*args, **kwargs) File "C:\Users\USER-PC\Downloads\ValorantStoreChecker-discord-bot-master\ValorantStoreChecker-discord-bot-master\bot.py", line 59, in on_message await bot.register_commands(commands=command, guild_id=message.guild.id, force=True) File "C:\Users\USER-PC\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 471, in register_commands registered = await register("bulk", data) File "C:\Users\USER-PC\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 351, in request raise Forbidden(response, data) discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access

everything seems correct but for some reason when i put -setup global or -setup guild it happens

Skin Teir Icons Aren't Loading

I'm not sure how to fix this issue because the icons are loading on my friends server but not on mine. I'm not sure whether this is an issue with the bot or my server perms but I'm posting it here in case others might be having the same issue.
image

got error when using -setup guild

I got a problem when i try to use -setup guild. it says discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
what should i do?
image

The application did not respond

The bot works for a couple of days without any problem, but today when I tried to login to my account I got this respond "The application did not respond". Any idea how to fix this?

image
And the server logs
image
thanks in advance!

Often times /store will display another user

For some context I host the bot and have it in my main discord server so me and my friends can use it to check the store, however lately its started showing me other users shops when I do /store it usually fixes itself if I type /store again but this bug is really annoying and I was wondering if you have a fix

Failed to run the bot.py

i dont know what happen with this code when i running bot.py this code is error, could u help me
Screenshot (1753)

ImportError 'TextStyle' from 'discord'

Getting this ImportError while trying to set up bot.

/Downloads/Valorant-DiscordBot-master/utils/valorant/view.py", line 5, in <module> from discord import Interaction, TextStyle, ui ImportError: cannot import name 'TextStyle' from 'discord' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/__init__.py)

Error when "/store"

What can I do for this?
installed all requirements and invites bot as "Bot" and "application.commands"

image
image

Cannot connect to host auth.riotgames.com:443

Capture
Cannot connect to host auth.riotgames.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

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.