You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Burl%7D?q=api&page=32&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=api
Returns an array of strings in format "username" or "username/projectName"
Found 11767 results for "api"(1960ms)
1920// Get guild information to check for owner
21const guildResponse = await fetch(`https://discord.com/api/v10/guilds/${guildId}`, {
22headers: {
23Authorization: `Bot ${token}`,
3334// Get member to check for administrator permissions
35const memberResponse = await fetch(`https://discord.com/api/v10/guilds/${guildId}/members/${userId}`, {
36headers: {
37Authorization: `Bot ${token}`,
4647// Fetch all roles in the guild
48const rolesResponse = await fetch(`https://discord.com/api/v10/guilds/${guildId}/roles`, {
49headers: {
50Authorization: `Bot ${token}`,
119const token = Deno.env.get("DISCORD_BOT_TOKEN");
120// First, get the role information to include in the response
121const roleResponse = await fetch(`https://discord.com/api/v10/guilds/${guildId}/roles`, {
122headers: {
123Authorization: `Bot ${token}`,
132133// Get the member to check if they have the role
134const memberResponse = await fetch(`https://discord.com/api/v10/guilds/${guildId}/members/${userId}`, {
135headers: {
136Authorization: `Bot ${token}`,
147const action = hasRole ? "removed" : "added";
148const toggleResponse = await fetch(
149`https://discord.com/api/v10/guilds/${guildId}/members/${userId}/roles/${roleId}`,
150{
151method,
207208// Fetch all roles from the guild
209const roleResponse = await fetch(`https://discord.com/api/v10/guilds/${guildId}/roles`, {
210headers: {
211Authorization: `Bot ${token}`,
19console.log(`📤 Sending follow-up message: ${content}`);
20try {
21await fetch(`https://discord.com/api/v10/webhooks/${applicationId}/${interactionToken}/messages/@original`, {
22method: "PATCH",
23headers: {