44using System . Text ;
55using System . Threading ;
66using System . Threading . Tasks ;
7- using System . Xml . Linq ;
87using Newtonsoft . Json . Linq ;
98using System . IO ;
9+ using System . Net ;
10+ using System . Diagnostics ;
1011
1112namespace MultiTool
1213{
1314 public class Program
1415 {
15- public static void Main ( string [ ] args )
16+ static async Task Main ( string [ ] args )
1617 {
1718 Console . Title = "Multi-Tool" ;
1819 Console . Clear ( ) ;
1920 Console . WriteLine ( "Welcome to Multi-Tool" ) ;
2021 Console . WriteLine ( ) ;
2122 Console . WriteLine ( "Options:" ) ;
2223 Console . logOption ( "1" , "Nitro Gen" ) ;
23- Console . logOption ( "2" , "Nuker " ) ;
24- Console . logOption ( "3" , "Option 3 " ) ;
24+ Console . logOption ( "2" , "User LookUp " ) ;
25+ Console . logOption ( "3" , "Guild LookUp " ) ;
2526 Console . logOption ( "0" , "Exit" ) ;
2627
2728 Console . log ( "Enter your choice: " , false ) ;
@@ -38,9 +39,39 @@ public static void Main(string[] args)
3839 Console . log ( $ "You can find the results in: { Environment . CurrentDirectory + "\\ results.txt" } ") ;
3940 }
4041 }
41- if ( choice == "2" )
42+ else if ( choice == "2" )
4243 {
44+ Console . log ( "Enter the user ID: " , false ) ;
45+ string userId = Console . ReadLine ( ) ;
4346
47+ try
48+ {
49+ string [ ] userInfo = await DiscordLookup . GetUserInfo ( userId ) ;
50+ Console . log ( $ "Username: { userInfo [ 0 ] } ") ;
51+ Console . log ( $ "Global Username: { userInfo [ 1 ] } ") ;
52+ Console . log ( $ "Avatar URL: { userInfo [ 2 ] } ") ;
53+ Console . log ( $ "Banner URL: { userInfo [ 3 ] } ") ;
54+ }
55+ catch ( HttpRequestException e )
56+ {
57+ Console . log ( $ "Error retrieving user information: { e . Message } ") ;
58+ }
59+ }
60+ else if ( choice == "3" )
61+ {
62+ Console . log ( "Enter the guild ID: " , false ) ;
63+ string guildId = Console . ReadLine ( ) ;
64+
65+ try
66+ {
67+ string [ ] guildInfo = await DiscordLookup . GetGuildInfo ( guildId ) ;
68+ Console . log ( $ "Name: { guildInfo [ 0 ] } ") ;
69+ Console . log ( $ "invite: { guildInfo [ 1 ] } ") ;
70+ }
71+ catch ( HttpRequestException e )
72+ {
73+ Console . log ( $ "Error retrieving user information: { e . Message } ") ;
74+ }
4475 }
4576 else
4677 {
@@ -130,5 +161,40 @@ public static async Task SendPostRequest()
130161 }
131162 public static void Save ( string url ) { using ( StreamWriter sw = new StreamWriter ( folderPath , true ) ) { sw . WriteLine ( url ) ; } }
132163 }
164+ public class DiscordLookup
165+ {
166+ private static HttpClient client = new HttpClient ( ) ;
167+ public static async Task < string [ ] > GetUserInfo ( string userId )
168+ {
169+ string url = $ "https://discordlookup.mesavirep.xyz/v1/user/{ userId } ";
170+ HttpResponseMessage response = await client . GetAsync ( url ) ;
171+ response . EnsureSuccessStatusCode ( ) ;
172+
173+ string responseBody = await response . Content . ReadAsStringAsync ( ) ;
174+ JObject userJson = JObject . Parse ( responseBody ) ;
175+
176+ string globalnameUrl = userJson [ "global_name" ] . ToString ( ) ;
177+ string username = userJson [ "username" ] . ToString ( ) ;
178+ string avatarUrl = userJson [ "avatar" ] [ "link" ] . ToString ( ) ;
179+ string bannerUrl = userJson [ "banner" ] [ "link" ] . ToString ( ) ;
180+
181+
182+ return new string [ ] { username , globalnameUrl , avatarUrl , bannerUrl } ;
183+ }
184+ public static async Task < string [ ] > GetGuildInfo ( string guildId )
185+ {
186+ string url = $ "https://discordlookup.mesavirep.xyz/v1/guild/{ guildId } ";
187+ HttpResponseMessage response = await client . GetAsync ( url ) ;
188+ response . EnsureSuccessStatusCode ( ) ;
189+
190+ string responseBody = await response . Content . ReadAsStringAsync ( ) ;
191+ JObject userJson = JObject . Parse ( responseBody ) ;
192+
193+ string name = userJson [ "name" ] . ToString ( ) ;
194+ string instantinvite = userJson [ "instant_invite" ] . ToString ( ) ;
133195
196+
197+ return new string [ ] { name , instantinvite } ;
198+ }
199+ }
134200}
0 commit comments