mxrch / HackTheBot

A Discord Bot in Python for Hack The Box members.
Mozilla Public License 2.0
40 stars 11 forks source link

Script debug and API v4 implement in buggy scrapy part #5

Closed psyray closed 3 years ago

psyray commented 3 years ago

Your bot is fully effective now. I have migrated some API to v4 (the ones with the buggy scraper). It's a work in progress, I will continue to migrate all the section to the new API. And also i will continue to clean up the code

Just one question, I didn't find why the bot go automatically offline after ~ 20mn. Is there a way to prevent ? I'm not very familiar with async and trio and this is my first python project (I'm a PHP dev)

Here's the config with some added values (the hardcoded urls...). Feel free to test and make feedback ;)

HTB = {
    "email": "your@email",
    "password": "pass",
    "htb_url": "https://www.hackthebox.eu",
    "api_url_v3": "https://www.hackthebox.eu/api",
    "api_url": "https://www.hackthebox.eu/api/v4",
    "api_token": "your_api_token",
}

discord = {
    "bot_token": "your_bot_token",
    "guild_name": "your_guild_name",
    "shoutbox_channel": "your_shoutbox_channel",
}

options = {
    "writeup_legit": True,
}

emojis = {
    "linux": "🐧",
    "windows": "🪟",
}

roles = {
    "noob": "HTB - Noob",
    "script kiddie": "HTB - Script kiddie",
    "hacker": "HTB - Hacker",
    "pro hacker": "HTB - Pro hacker",
    "elite hacker": "HTB - Elite hacker",
    "guru": "HTB - Guru",
    "omniscient": "HTB - Omniscient"
}
mxrch commented 3 years ago

Wow, great work ! Unfortunately no, I don't know why this goes automatically offline, I'll surely check this out.

psyray commented 3 years ago

You're welcome. You've done a really great work too ;) If you want I'll implement the remaining api v4 calls and you invetisgate about the offline part. I think there is a crash somewhere, but as the script seems to failed silently, no way to figure out what the problem is. Maybe a bad api call. If I finish the api v4 part maybe the bug should gone. Soyons optimistes :D