réplica de
				https://gitlab.com/ceda_ei/Quadnite-Bot
				synced 2025-10-31 17:20:05 +01:00 
			
		
		
		
	Add /wiki for wikipedia
Este commit está contenido en:
		| @@ -3,7 +3,8 @@ word - Get a random word | ||||
| words - Get n random words | ||||
| kys - Kill yourself | ||||
| coin - Tosses a coin | ||||
| wiki - search the Arch wiki | ||||
| wiki - search Wikipedia | ||||
| arch_wiki - search the Arch wiki | ||||
| is - Is <your question> | ||||
| are - Are <your question> | ||||
| can - Can <your question> | ||||
|   | ||||
							
								
								
									
										10
									
								
								webhook.php
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								webhook.php
									
									
									
									
									
								
							| @@ -151,7 +151,7 @@ function rand_question() | ||||
|   send_text($question); | ||||
| } | ||||
|  | ||||
| function arch_wiki() | ||||
| function media_wiki($base_url) | ||||
| { | ||||
|   global $command_list; | ||||
|   $search_query = ""; | ||||
| @@ -165,7 +165,7 @@ function arch_wiki() | ||||
|     send_text('Missing search query'); | ||||
|     return; | ||||
|   } | ||||
|   $url = "https://wiki.archlinux.org/api.php?action=opensearch&format=json&search=" . urlencode($search_query); | ||||
|   $url = $base_url . "?action=opensearch&format=json&search=" . urlencode($search_query); | ||||
|   $a = json_decode(file_get_contents($url)); | ||||
|   $names = $a[1]; | ||||
|   $urls = $a[3]; | ||||
| @@ -271,9 +271,13 @@ $modules = array( | ||||
|     "command" => "/question", | ||||
|     "function" => "rand_question();" | ||||
|   ), | ||||
|   array( | ||||
|     "command" => "/arch_wiki", | ||||
|     "function" => "media_wiki('https://wiki.archlinux.org/api.php');" | ||||
|   ), | ||||
|   array( | ||||
|     "command" => "/wiki", | ||||
|     "function" => "arch_wiki();" | ||||
|     "function" => "media_wiki('https://en.wikipedia.org/w/api.php');" | ||||
|   ), | ||||
|   array( | ||||
|     "command" => "/coin", | ||||
|   | ||||
		Referencia en una nueva incidencia
	
	Block a user