Discord Rich Presence for Team Fortress 2

Overview

Github all releases GitHub release GitHub Release Date Platform: Windows Kataiser on Steam Ko-fi

GitHub commits since latest release GitHub last commit Updates Codacy Badge Github Actions build Coverage

TF2 Rich Presence

Discord Rich Presence for Team Fortress 2

  • Detects current game state, queue info, playtime, and more
  • Configurable, reliable, and performance-efficient
  • Version 2 (GUI, map images, and more): out now!

Preview image

GUI preview image

Download and install

Installer: TF2RichPresence_v2.1.1_setup (14.7 MB)
Alternatively, get the latest autobuild (may be untested/buggy): TF2RichPresence_v2.1.1_setup
Note that having Python installed is not required. Requires Discord and Steam to be running as well, and will wait until the game and both programs are running.

Changelogs

Linux and MacOS support?

At the moment, both are considered unsupported. They probably work since Jan200101 did some work on Linux a while ago, but the release builds are formatted for Windows. Contributors are very welcome! Also check out cyclowns/tf2-discord, which is confirmed to work on both Windows and Linux, or EmeraldSnorlax/TF2-RPC, which is a much less mature program but is built on Linux and theoretically cross-platform too. Alternatively, following most or all of the "building from source" instructions might work, or possibly running python resources/launcher.py in a --nocython build.

VAC safe?

Almost certainly. If you don't want to risk it then fair enough, but I've run this on my main account for years and feel comfortable with it. The game's runtime and memory are never touched in any way to read its state. For transparency, here's the complete list of external files that are read from and/or written to: \tf\console.log, \tf\cfg\*class*.cfg and steam_appid.txt in TF2's install, and \userdata\*id*\config\localconfig.vdf and \steamapps\libraryfolders.vdf in Steam's. The game process is also queried for its start time and install path, and the server you're playing on is queried for player count or kill counts. RCON is not used.

Building from source

For making and testing changes, or simply always running the most up-to-date code.

  1. Either clone the repo or download the source.
  2. Copy the entire source to another location (sorry) and put the files outside of TF2 Rich Presence into that folder.
  3. Make sure the python and pip commands point to Python 3.9.x (future versions should work too).
  4. Install a C compiler (see Installing Cython). I personally use MinGW, but it's a pain on Windows. Alternatively, use the --nocython flag when building to disable compiling.
  5. From within TF2 Rich Presence, run pip install -r requirements.txt.
  6. Either run python build.py to compile and build, or python launcher.py to launch in debug mode.

Version 2 goals

  • A GUI (Done, ended up using discoIPC still)
    • I'm fairly confident I know how to implement this (it's a bit of work though)
    • Would require doing RPC with pypresence due to a bug in discoIPC
    • Would also have the benefit of not requiring two (slow) Python interpreter launches
    • This is the only criteria I'll require for release v2.0, any of the others could be in later versions
  • Run as a service (Abandoned because "launch TF2" button OP)
  • Map-specific images, instead of gamemodes (Done, also Discord increased the limit to 300)
    • Would cause all sorts of problems, including removing the class icon style option
    • Discord art asset limit is 150, the rest of the program uses 47, and there are 118 vanilla maps in the game
    • So won't be able to get every map, can just limit to the most popular though
  • A proper installer (Done with Inno Setup, no autoupdater though)
    • Also maybe store DB.json and settings in AppData\Roaming
    • Make a Chocolatey package as well, ideally would need to fix antivirus detection
    • Possibly include an autoupdater, either Squirrel or rolling my own
Comments
  • The application does not load

    The application does not load

    When I want to open the TF2 Rich Presence application, it keeps loading.

    When you hover the cursor over the application icon, it appears all black and if you click on it, it does not open.

    TF2 Rich Presence crash

    This happens to me with both the stable version and the latest development version: eaa2eaa7334dc9275572e3035f8148854871f96f

    Opening the application with the administrator permission does not solve anything, in fact an error message appears (the latter I only tested in the latest development version). TF2 RIch Presence crash (Admin)

    opened by ArmorKeik 24
  • Giving Error at Startup

    Giving Error at Startup

    I extracted the .zip to a folder on my desktop and when I started it, it gave me this text and said it'll restart after 5 seconds:

    Traceback (most recent call last): File "C:\Users\Teddy\Desktop\Games\Game Folders\TF2 Rich Presence v1.13\resou rces\launcher.py", line 60, in launch loaded_module.launch() File "main.py", line 91, in main.launch File "main.py", line 81, in main.launch File "main.py", line 128, in main.TF2RichPresense.run File "main.py", line 165, in main.TF2RichPresense.loop_body UnboundLocalError: local variable 'valid_usernames' referenced before assignment

    After it restarts, it shows the same thing again.

    opened by KahootVult 23
  • Crash when loading tr_walkway_rc2

    Crash when loading tr_walkway_rc2

    Note1:

    that I removed the following lines as for the program not finding my console log file (Even though it works just fine after removing these lines) Only thing not working is the automatic download of map images... # -condebug is kinda necessary so just wait to restart if it's not there input("Press enter to retry\n") raise SystemExit

    Note2: I changed the instructions on how to enable the console dump to "You look great today!"

    CRASHLOG:

    TF2 Rich Presence has crashed, the error should now be reported to the developer. (Consider opening an issue at https://github.com/Kataiser/tf2-rich-presence/issues) Restarting in 2 seconds... You look great today!

    Traceback (most recent call last): File "E:\EigeneDateien\RICHPRESENCE\resources\main.py", line 50, in launch app.run() File "E:\EigeneDateien\RICHPRESENCE\resources\main.py", line 85, in run self.loop_body() File "E:\EigeneDateien\RICHPRESENCE\resources\main.py", line 164, in loop_body top_line, bottom_line, server_ip = self.interpret_console_log(os.path.join(tf2_location, 'tf', 'console.log'), valid_usernames) File "E:\EigeneDateien\RICHPRESENCE\resources\main.py", line 346, in interpret_console_log if 'Disconnect by user' in line and [i for i in user_usernames if i in line]: TypeError: 'NoneType' object is not iterable `

    opened by Gensokian 13
  • Cannot open app UI after v2.1 release

    Cannot open app UI after v2.1 release

    Been using this rich presence for some time now, worked pretty good (except the things at the bottom of this post), but after v2.1 the whole UI for the rich presence is broken. I simply cannot alt tab, or click on the app when its started. obrázok_2021-10-10_124123 image

    Other things i have noticed:

    • Class is always "unselected" (Tried re-installing the RP app and TF2, didn´t help).
    • Sometimes after disconnecting from a server, it will show the server (instead of being in the main menu) info untill i requeue or join another server.
    • The kill counter didn´t work once, fixed it by just restarting TF2 (Seems to be fixed now).

    Off-topic: Do you need a translator by any chance?

    opened by Salat1K69 7
  • crash when launching the exe

    crash when launching the exe

    whenever i launch any of the exe files, it doesn't work. the error is

    Traceback (most recent call last): File "F:\TF2 Rich Presence v1.13.1\resources\launcher.py", line 67, in launch loaded_module.launch() File "main.py", line 102, in main.launch File "main.py", line 90, in main.launch File "settings.py", line 421, in settings.compare_settings KeyError: 'trim_console_log'

    i think this might be caused by my game directory being under a different drive to steam?

    opened by MilkMGN 7
  • Cannot build?

    Cannot build?

    How long does it take to build the source? Did everything exactly as said but it is stuck on "Building TF2 Rich Presence v1.13.2". Using Python v3.7.7

    opened by ghost 4
  • translation failure in the Spanish language

    translation failure in the Spanish language

    Hello, I would like to report a translation failure in the Spanish language. To begin with, the TF2 icon says "Equipo Fortaleza 2" in Spanish, we do not say it directly, we called it in English originally. And also in the classes, we don't call the classes in their Spanish translation, we originally called it as it is in English, well that's it, the rest is well translated ...

    image

    image

    opened by LechuMini 4
  • Licensing issues

    Licensing issues

    At the moment the 7zip executable is being bundled in this repository, which is licensed under GNU LGPL because of that tf2-rich-presence must be under LGPL 2.1 or later

    opened by Jan200101 4
  • Windows Defender Alert And Virustotal Virus

    Windows Defender Alert And Virustotal Virus

    Both self extract and zip triggers windows Defender.

    https://www.virustotal.com/gui/file/3357e0c1df2c203ea427034593c2a0a8c5a84e651ac3e989014af55889776a2c/detection

    opened by JoachimFlottorp 3
  • Fixed Russian localization

    Fixed Russian localization

    I've fixed completely broken translations and converted non-translateable sentences/words to their commonly used cyrillic counterparts. Other translations were slightly changed to be more accurate and some were left untouched. I've also fixed some cases I've noticed where TF2 was translated literally in other languages. Apologies for the entire file being the diff, I didn't have much sleep so I just copied the file from raw into my editor.

    opened by forusu 3
  • Program crashes on initialising

    Program crashes on initialising

    Probably a duplication from issue #90 but since that one was already closed. Doesn't matter what exe I start from, the program crashes. I assume this is due some older settings leftover from an older version of the program.

    [1587834973 +0.0006] INFO: Initializing TF2 Rich Presence v1.13.1 [1587834973 +0.0001] DEBUG: Current log: logs\TF2RP_ByteCruncher_maxim_v1.13.1_18377.log [1587834973 +0.0000] INFO: Log level: Debug [1587834973 +0.0066] DEBUG: Welcoming with message version 1 [1587834973 +0.0061] DEBUG: Checking for updates, timeout: 5.0 secs [1587834973 +0.2303] DEBUG: Up to date (v1.13.1) [1587834973 +0.0001] DEBUG: Closing log file via destructor [1587834974 +0.0083] INFO: Starting TF2 Rich Presence v1.13.1 [1587834974 +0.0003] DEBUG: Deleted 0 log(s): [] [1587834974 +0.0001] DEBUG: Compressed 0 log(s): [] [1587834974 +0.0001] DEBUG: CPU: 4 cores, 4 threads [1587834974 +0.0004] DEBUG: Platform: {'architecture': ('32bit', 'WindowsPE'), 'machine': 'AMD64', 'system': 'Windows', 'platform': 'Windows-10-10.0.18362-SP0', 'processor': 'Intel64 Family 6 Model 94 Stepping 3, GenuineIntel', 'python_version_tuple': ('3', '7', '6')} [1587834974 +0.0007] DEBUG: Set process priorities from (<Priority.NORMAL_PRIORITY_CLASS: 32>, <IOPriority.IOPRIO_NORMAL: 2>) to (<Priority.BELOW_NORMAL_PRIORITY_CLASS: 16384>, <IOPriority.IOPRIO_LOW: 1>) [1587834974 +0.0004] CRITICAL: Traceback (most recent call last): File "main.py", line 90, in main.launch File "settings.py", line 421, in settings.compare_settings KeyError: 'trim_console_log'

    Then this error start looping every 5 seconds,

    [1587834974 +0.0000] DEBUG: Closing log file via destructor [1587834979 +0.0014] INFO: Starting TF2 Rich Presence v1.13.1 [1587834979 +0.0003] DEBUG: Deleted 0 log(s): [] [1587834979 +0.0001] DEBUG: Compressed 0 log(s): [] [1587834979 +0.0001] DEBUG: CPU: 4 cores, 4 threads [1587834979 +0.0003] DEBUG: Platform: {'architecture': ('32bit', 'WindowsPE'), 'machine': 'AMD64', 'system': 'Windows', 'platform': 'Windows-10-10.0.18362-SP0', 'processor': 'Intel64 Family 6 Model 94 Stepping 3, GenuineIntel', 'python_version_tuple': ('3', '7', '6')} [1587834979 +0.0002] DEBUG: Set process priorities from (<Priority.NORMAL_PRIORITY_CLASS: 32>, <IOPriority.IOPRIO_NORMAL: 2>) to (<Priority.BELOW_NORMAL_PRIORITY_CLASS: 16384>, <IOPriority.IOPRIO_LOW: 1>) [1587834979 +0.0004] CRITICAL: Traceback (most recent call last): File "main.py", line 90, in main.launch File "settings.py", line 421, in settings.compare_settings KeyError: 'trim_console_log'

    opened by TDarkShadow 3
  • Update pillow to 9.4.0

    Update pillow to 9.4.0

    This PR updates Pillow from 9.3.0 to 9.4.0.

    Changelog

    9.4.0

    ------------------
    
    - Fixed null pointer dereference crash with malformed font 6846
    [wiredfool, radarhere]
    
    - Return from ImagingFill early if image has a zero dimension 6842
    [radarhere]
    
    - Reversed deprecations for Image constants, except for duplicate Resampling attributes 6830
    [radarhere]
    
    - Improve exception traceback readability 6836
    [hugovk, radarhere]
    
    - Do not attempt to read IFD1 if absent 6840
    [radarhere]
    
    - Fixed writing int as ASCII tag 6800
    [radarhere]
    
    - If available, use wl-paste or xclip for grabclipboard() on Linux 6783
    [radarhere]
    
    - Added signed option when saving JPEG2000 images 6709
    [radarhere]
    
    - Patch OpenJPEG to include ARM64 fix 6718
    [radarhere]
    
    - Added support for I;16 modes in putdata() 6825
    [radarhere]
    
    - Added conversion from RGBa to RGB 6708
    [radarhere]
    
    - Added DDS support for uncompressed L and LA images 6820
    [radarhere, REDxEYE]
    
    - Added LightSource tag values to ExifTags 6749
    [radarhere]
    
    - Fixed PyAccess after changing ICO size 6821
    [radarhere]
    
    - Do not use EXIF from info when saving PNG images 6819
    [radarhere]
    
    - Fixed saving EXIF data to MPO 6817
    [radarhere]
    
    - Added Exif hide_offsets() 6762
    [radarhere]
    
    - Only compare to previous frame when checking for duplicate GIF frames while saving 6787
    [radarhere]
    
    - Always initialize all plugins in registered_extensions() 6811
    [radarhere]
    
    - Ignore non-opaque WebP background when saving as GIF 6792
    [radarhere]
    
    - Only set tile in ImageFile __setstate__ 6793
    [radarhere]
    
    - When reading BLP, do not trust JPEG decoder to determine image is CMYK 6767
    [radarhere]
    
    - Added IFD enum to ExifTags 6748
    [radarhere]
    
    - Fixed bug combining GIF frame durations 6779
    [radarhere]
    
    - Support saving JPEG comments 6774
    [smason, radarhere]
    
    - Added getxmp() to WebPImagePlugin 6758
    [radarhere]
    
    - Added &quot;exact&quot; option when saving WebP 6747
    [ashafaei, radarhere]
    
    - Use fractional coordinates when drawing text 6722
    [radarhere]
    
    - Fixed writing int as BYTE tag 6740
    [radarhere]
    
    - Added MP Format Version when saving MPO 6735
    [radarhere]
    
    - Added Interop to ExifTags 6724
    [radarhere]
    
    - CVE-2007-4559 patch when building on Windows 6704
    [TrellixVulnTeam, nulano, radarhere]
    
    - Fix compiler warning: accessing 64 bytes in a region of size 48 6714
    [wiredfool]
    
    - Use verbose flag for pip install 6713
    [wiredfool, radarhere]
    
    Links
    • PyPI: https://pypi.org/project/pillow
    • Changelog: https://pyup.io/changelogs/pillow/
    • Homepage: https://python-pillow.org
    opened by pyup-bot 0
  • Update sentry_sdk to 1.12.1

    Update sentry_sdk to 1.12.1

    This PR updates sentry_sdk from 1.11.1 to 1.12.1.

    The bot wasn't able to find a changelog for this release. Got an idea?

    Links
    • PyPI: https://pypi.org/project/sentry-sdk
    • Repo: https://github.com/getsentry/sentry-python
    opened by pyup-bot 0
  • Update lxml to 4.9.2

    Update lxml to 4.9.2

    This PR updates lxml from 4.9.1 to 4.9.2.

    Changelog

    4.9.2

    ==================
    
    Bugs fixed
    ----------
    
    * CVE-2022-2309: A Bug in libxml2 2.9.1[0-4] could let namespace declarations
    from a failed parser run leak into later parser runs.  This bug was worked around
    in lxml and resolved in libxml2 2.10.0.
    https://gitlab.gnome.org/GNOME/libxml2/-/issues/378
    
    Other changes
    -------------
    
    * LP1981760: ``Element.attrib`` now registers as ``collections.abc.MutableMapping``.
    
    * lxml now has a static build setup for macOS on ARM64 machines (not used for building wheels).
    Patch by Quentin Leffray.
    
    Links
    • PyPI: https://pypi.org/project/lxml
    • Changelog: https://pyup.io/changelogs/lxml/
    • Homepage: https://lxml.de/
    opened by pyup-bot 0
  • Update certifi to 2022.12.7

    Update certifi to 2022.12.7

    This PR updates certifi from 2022.9.24 to 2022.12.7.

    The bot wasn't able to find a changelog for this release. Got an idea?

    Links
    • PyPI: https://pypi.org/project/certifi
    • Repo: https://github.com/certifi/python-certifi
    opened by pyup-bot 0
  • Update charset-normalizer to 3.0.1

    Update charset-normalizer to 3.0.1

    This PR updates charset-normalizer from 2.1.1 to 3.0.1.

    The bot wasn't able to find a changelog for this release. Got an idea?

    Links
    • PyPI: https://pypi.org/project/charset-normalizer
    • Repo: https://github.com/Ousret/charset_normalizer
    opened by pyup-bot 0
  • Kill Counter and Player Count does not work and displays as

    Kill Counter and Player Count does not work and displays as "?/? and ?"

    opened by bobkinect98 1
Releases(v2.1.4)
Owner
Kataiser
Cory, 22, he/him. I also make bass music. Studying CS at UHCL.
Kataiser
Send Informative, Concise Slack Notifications With Minimal Effort

slack-templates Send Informative, Concise Slack Notifications With Minimal Effort slack-templates Slack Integration Available Templates Usage Report t

9 Nov 03, 2022
Bot per la chat live del corso di sistemi operativi UniBO

cravattaBot TL;DR: Ho fatto un bot telegram per la chat del corso di sistemi. Indice Installazione e prerequisiti Prerequisiti Installazione Setup Con

Alessandro Frau 3 May 21, 2022
Telegram music & video bot direct play music

Telegram music & video bot direct play music

noinoi-X 1 Dec 28, 2021
Telegram Music Bot for YouTube/SoundCloud/Mixcloud

Telegram Music Bot Telegram Music Bot for YouTube/SoundCloud/Mixcloud This bot downloads and sends the audio when someone send a YouTube/SoundCloud/Mi

Calls Music 76 Jan 02, 2023
An example of a chatbot with a number-based menu that can be used as a starting point for a project.

NumMenu Bot NumMenu Bot is an example chatbot showing a way to design a number-based menu assistant with Rasa. This type of bot is very useful on plat

Derguene 19 Nov 14, 2022
vk Bot because of which everyone will lag

VK-crash-bot open cmd and write: "pip install vk-api" To configure the bot, you need to open main.py and set the value to such variables as "token" an

NotQuki 0 Jun 05, 2022
Free and Open Source Channel/Group Voice chat music player for telegram ❤️ with button support Heroku Commands

ZeusMusic Requirements 📝 FFmpeg NodeJS nodesource.com Python 3.7 or higher PyTgCalls MongoDB 2nd Telegram Account (needed for userbot) 🧪 Get SESSION

ZeusNetwork 4 Jan 03, 2022
Using multiple API sources, create an app that allows users to filter through random locations based on their temperature range choices.

World_weather_analysis Overview Using multiple API sources, create an app that allows users to filter through random locations based on their temperat

Jason Boyer 2 Sep 16, 2022
Python wrapper for Gmailnator

Python wrapper for Gmailnator

h0nda 11 Mar 19, 2022
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

A . S . M . RADWAN 2 Apr 03, 2022
This is Pdisk Upload Bot made using Python with Pyrogram Framework. Its capable of uploading direct download link with thumbnail or without thumbnail & with Title Support.

Pdisk-Upload-Bot Introduction This Is PDisk Upload Bot Used To Upload Direct Link To Pdisk With Thumb Support Deploy Heroku Deploy Local Deploy pip in

HEIMAN PICTURES 32 Oct 21, 2022
Python library for the Stripe API.

Stripe Python Library The Stripe Python library provides convenient access to the Stripe API from applications written in the Python language. It incl

Stripe 1.3k Jan 03, 2023
Check your bot status automatically using userbot, simply and easy

Status Checker Userbot check your bot status automatically using userbot, simply and easy. Mandatory Vars API_ID : Telegram API_ID, get it from my.tel

ALBY 6 Feb 20, 2022
:electric_plug: Generating short urls with python has never been easier

pyshorteners A simple URL shortening API wrapper Python library. Installing pip install pyshorteners Documentation https://pyshorteners.readthedocs.i

Ellison 351 Jan 03, 2023
Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado sistema ou programa.

LoginPy Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado si

Jonas Carvalho 4 Dec 23, 2021
A drop-in vanilla discord.py cog to add slash command support with little to no code modifications

discord.py /slash cog A drop-in vanilla discord.py cog that acts as a translation layer to add slash command support with little to no code modificati

marshall 3 Jun 01, 2022
GitPython is a python library used to interact with Git repositories.

Gitoxide: A peek into the future… I started working on GitPython in 2009, back in the days when Python was 'my thing' and I had great plans with it. O

3.8k Jan 03, 2023
Coinbase Pro API interface framework and tooling

neutrino This project has just begun. Rudimentary API documentation Installation Prerequisites: Python 3.8+ and Git 2.33+ Navigate into a directory of

Joshua Chen 1 Dec 26, 2021
Currency Merger is a simple tool for joining values in different currencies

Currency Merger Description Currency Merger is a simple tool for joining values in different currencies. For example, if I have money in USD, EUR, BRL

Arthur Diniz 1 Feb 08, 2022
A Bot to Track Kernel Upstreams from kernel.org and Post it on Telegram Channel

Channel Kernel Tracker is the channel where the bot will be sending the updates in. Introduction This is a Telegram Bot to Track Kernel Upstreams kern

Kartikeya Hegde 3 Oct 05, 2021