tModLoader / tModLoader-Discord-Bot

A Discord bot written in C# using Discord.Net to serve the tModLoader server. Uses .NET Core 2.0+
https://tmodloader.net/
Apache License 2.0
13 stars 9 forks source link

Use id instead of name for recruitment #20

Open Metacinnabar opened 3 years ago

Metacinnabar commented 3 years ago

Overview

As shown here, recruitment messages rely on usernames instead of user ids.

This breaks things such as when a user changes their name, or if their name has # in it.

Metacinnabar commented 3 years ago

From looking at the pre-existing code, the only fix I can think of is adding the user id to the embed author such as GoodPro712#1733 (550907912281915412), and then using that id to distinguish the author instead of using their username (which also has other issues such as if someone has a # in their username). Please let me know what you think the correct way to fix this is.

Jofairden commented 2 years ago

This should be using the UUID (discord snowflake id of the user) It can simply be compared against the uuid of the author of the embed embed.Author.Id == user.Id