From 9ea3460e3d8d16569334e24d799d304ec5423aae Mon Sep 17 00:00:00 2001 From: Alan Beatty Date: Mon, 3 Jan 2022 12:08:41 +0000 Subject: [PATCH 1/7] small bugfix for hangman --- src/NadekoBot/Modules/Games/Common/Hangman/HangmanGame.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Games/Common/Hangman/HangmanGame.cs b/src/NadekoBot/Modules/Games/Common/Hangman/HangmanGame.cs index 006ab3ec9..60f9394c7 100644 --- a/src/NadekoBot/Modules/Games/Common/Hangman/HangmanGame.cs +++ b/src/NadekoBot/Modules/Games/Common/Hangman/HangmanGame.cs @@ -104,7 +104,8 @@ namespace NadekoBot.Modules.Games.Hangman CurrentPhase = Phase.Ended; return GetState(GuessResult.Win); } - + + _correct.Add(charGuess); return GetState(GuessResult.Guess); } From 89b0eabd41549a746b3ee5636b159ca5ca0c0e32 Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Mon, 3 Jan 2022 12:09:06 +0000 Subject: [PATCH 2/7] added: Enable "custom search api" for GoogleAPIKey section. --- docs/jsons-explained.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/jsons-explained.md b/docs/jsons-explained.md index c4a341769..e50f6f241 100644 --- a/docs/jsons-explained.md +++ b/docs/jsons-explained.md @@ -11,6 +11,9 @@ This part is completely optional, **however it's necessary for music and a few o - Under the `YouTube APIs` section - Select `YouTube Data API v3`, - Click enable. + - Search for `Custom Search API` + - Select `Custom Search API`, + - Click enable. - Open up the `Navigation menu` on the top right with the three lines. - select `APIs & Services`, then select `Credentials`, - Click `Create Credentials` button, @@ -21,7 +24,7 @@ This part is completely optional, **however it's necessary for music and a few o - Open up `creds.yml` and look for `GoogleAPIKey`, paste your API key after the `:`. - It should look like this: ```yml - GoogleApiKey: "AIzaSyDSci1sdlWQOWNVj1vlXxxxxxbk0oWMEzM" + GoogleApiKey:"AIzaSyDSci1sdlWQOWNVj1vlXxxxxxbk0oWMEzM ``` - **MashapeKey** - Required for Hearthstone cards. From 197ee9f5ffc7b44206b3d6cdf5823b1b405ed52a Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Tue, 4 Jan 2022 00:19:28 +0000 Subject: [PATCH 3/7] fixed GoogleApiKey, formatting error, thanks to alaruba for catching the mistake --- docs/jsons-explained.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/jsons-explained.md b/docs/jsons-explained.md index e50f6f241..1af5927a9 100644 --- a/docs/jsons-explained.md +++ b/docs/jsons-explained.md @@ -24,7 +24,7 @@ This part is completely optional, **however it's necessary for music and a few o - Open up `creds.yml` and look for `GoogleAPIKey`, paste your API key after the `:`. - It should look like this: ```yml - GoogleApiKey:"AIzaSyDSci1sdlWQOWNVj1vlXxxxxxbk0oWMEzM + GoogleApiKey: AIzaSyDSci1sdlWQOWNVj1vlXxxxxxbk0oWMEzM ``` - **MashapeKey** - Required for Hearthstone cards. From accfb2d1ac611730ef81e14e2ccccb3129a6fada Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Tue, 4 Jan 2022 17:58:47 +0000 Subject: [PATCH 4/7] updated creds.yml example owner ID section --- docs/jsons-explained.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/jsons-explained.md b/docs/jsons-explained.md index 1af5927a9..0ed036302 100644 --- a/docs/jsons-explained.md +++ b/docs/jsons-explained.md @@ -98,11 +98,10 @@ version: 1 token: 'MTE5Nzc3MDIxMzE5NTc3NjEw.VlhNCw.BuqJFyzdIUAK1PRf1eK1Cu89Jew' # List of Ids of the users who have bot owner permissions # **DO NOT ADD PEOPLE YOU DON'T TRUST** -ownerIds: [ - 105635123466156544, - 145521851676884992, - 341420590009417729 -] +ownerIds: + - 105635123466156544 + - 145521851676884992 + - 341420590009417729 # The number of shards that the bot will running on. # Leave at 1 if you don't know what you're doing. totalShards: 1 From 5b9abeb0b20051ac8f12a57e7c116cfd4051edac Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Wed, 5 Jan 2022 02:26:53 +0000 Subject: [PATCH 5/7] Omitted comma explanation for multi owner ID section to avoid confusion --- docs/creds-guide.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/creds-guide.md b/docs/creds-guide.md index 7e70afd3e..2fb856dfa 100644 --- a/docs/creds-guide.md +++ b/docs/creds-guide.md @@ -13,8 +13,13 @@ This document aims to guide you through the process of creating a Discord accoun - Click on the `Add a Bot` button and confirm that you do want to add a bot to this app. - **Optional:** Add bot's avatar and description. - Copy your Token to `creds.yml` as shown above. -- Scroll down to the `Privileged Gateway Intents` section and enable both intents. - These are required for a number of features to function properly, and should both be on. +- Scroll down to the `Privileged Gateway Intents` section + - Enabled the following: + - PRESENCE INTENT + - SERVER MEMBERS INTENT + - MESSAGE CONTENT INTENT + +These are required for a number of features to function properly, and all should be on. ##### Getting Owner ID*(s)*: @@ -32,7 +37,7 @@ For a single owner, it should look like this: - 105635576866156544 ``` -For multiple owners, it should look like this (pay attention to the commas, the last ID should **never** have a comma next to it): +For multiple owners, it should look like this: ```yml OwnerIds: @@ -56,4 +61,4 @@ For multiple owners, it should look like this (pay attention to the commas, the That's it! You may now go back to the installation guide you were following before 🎉 -[DiscordApp]: https://discordapp.com/developers/applications/me \ No newline at end of file +[DiscordApp]: https://discordapp.com/developers/applications/me From a2d15069157fd9c34d5fd1e804cad67024a8cdb4 Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Wed, 5 Jan 2022 02:27:46 +0000 Subject: [PATCH 6/7] Transferred over VPS guide from 1.9 --- docs/guides/linux-guide.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/guides/linux-guide.md b/docs/guides/linux-guide.md index 5d37c2f75..83d43a965 100644 --- a/docs/guides/linux-guide.md +++ b/docs/guides/linux-guide.md @@ -17,7 +17,7 @@ Open Terminal (if you're on an installation with a window manager) and navigate 5. Copy the creds.yml template `cp nadekobot/output/creds_example.yml nadekobot/output/creds.yml` 6. Open `nadekobot/output/creds.yml` with your favorite text editor. We will use nano here - `nano nadekobot/output/creds.yml` -7. [Enter your bot's token](../../creds-guide) +7. [Click here to follow creds guide](../../creds-guide) - After you're done, you can close nano (and save the file) by inputting, in order - `CTRL` + `X` - `Y` @@ -49,7 +49,7 @@ Open Terminal (if you're on an installation with a window manager) and navigate - `cp creds_example.yml creds.yml` 6. Open `creds.yml` with your favorite text editor. We will use nano here - `nano nadekobot/output/creds.yml` -8. [Enter your bot's token](../../creds-guide) +8. [Click here to follow creds guide](../../creds-guide) - After you're done, you can close nano (and save the file) by inputting, in order - `CTRL` + `X` - `Y` @@ -244,3 +244,34 @@ This method is similar to the one above, but requires one extra step, with the a 5. Start Nadeko: - `sudo systemctl start nadeko.service && sudo systemctl enable nadeko.service` + +### Setting up Nadeko on a Linux VPS (Digital Ocean Droplet) + +If you want Nadeko to play music for you 24/7 without having to hosting it on your PC and want to keep it cheap, reliable and convenient as possible, you can try Nadeko on Linux Digital Ocean Droplet using the link [DigitalOcean](http://m.do.co/c/46b4d3d44795/) (by using this link, you will get **$10 credit** and also support Nadeko) + +**Setting up NadekoBot** +Assuming you have followed the link above to setup an account and a Droplet with a 64-bit operational system on Digital Ocean and got the `IP address and root password (in your e-mail)` to login, it's time to get started. + +**This section is only relevant to those who want to host Nadeko on DigitalOcean. Go through this whole section before setting the bot up.** + +#### Prerequisites + +- Download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) +- Download [WinSCP](https://winscp.net/eng/download.php) *(optional)* +- [Create and invite the bot](../../creds-guide). + +#### Starting up + +- **Open PuTTY** and paste or enter your `IP address` and then click **Open**. + If you entered your Droplets IP address correctly, it should show **login as:** in a newly opened window. +- Now for **login as:**, type `root` and press enter. +- It should then ask for a password. Type the `root password` you have received in your e-mail address, then press Enter. + +If you are running your droplet for the first time, it will most likely ask you to change your root password. To do that, copy the **password you've received by e-mail** and paste it on PuTTY. + +- To paste, just right-click the window (it won't show any changes on the screen), then press Enter. +- Type a **new password** somewhere, copy and paste it on PuTTY. Press Enter then paste it again. + +**Save the new password somewhere safe.** + +After that, your droplet should be ready for use. [Follow the guide from the beginning](#linux-from-source) to set Nadeko up on your newly created VPS. From af343ac1f0818af48931510984626ae76f6b6a48 Mon Sep 17 00:00:00 2001 From: ZeroNyan Date: Wed, 5 Jan 2022 02:28:58 +0000 Subject: [PATCH 7/7] Add safesearch to .img when using google --- src/NadekoBot/Services/Impl/GoogleApiService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Services/Impl/GoogleApiService.cs b/src/NadekoBot/Services/Impl/GoogleApiService.cs index aa666ddf8..a5f408290 100644 --- a/src/NadekoBot/Services/Impl/GoogleApiService.cs +++ b/src/NadekoBot/Services/Impl/GoogleApiService.cs @@ -1,4 +1,4 @@ -using Google; +using Google; using Google.Apis.Customsearch.v1; using Google.Apis.Services; using Google.Apis.Urlshortener.v1; @@ -220,6 +220,7 @@ namespace NadekoBot.Services req.Fields = "items(image(contextLink,thumbnailLink),link)"; req.SearchType = CseResource.ListRequest.SearchTypeEnum.Image; req.Start = new NadekoRandom().Next(0, 20); + req.Safe = CseResource.ListRequest.SafeEnum.Active; var search = await req.ExecuteAsync().ConfigureAwait(false); @@ -388,4 +389,4 @@ namespace NadekoBot.Services return mode; } } -} \ No newline at end of file +}