commit
8c99a9f361
@ -45,6 +45,10 @@ Command and aliases | Description | Usage
|
|||||||
`.iam` | Adds a role to you that you choose. Role must be on a list of self-assignable roles. | `.iam Gamer`
|
`.iam` | Adds a role to you that you choose. Role must be on a list of self-assignable roles. | `.iam Gamer`
|
||||||
`.iamnot` `.iamn` | Removes a role to you that you choose. Role must be on a list of self-assignable roles. | `.iamn Gamer`
|
`.iamnot` `.iamn` | Removes a role to you that you choose. Role must be on a list of self-assignable roles. | `.iamn Gamer`
|
||||||
`.slowmode` | Toggles slowmode. Disable by specifying no parameters. To enable, specify a number of messages each user can send, and an interval in seconds. For example 1 message every 5 seconds. **Requires ManageMessages server permission.** | `.slowmode 1 5` or `.slowmode`
|
`.slowmode` | Toggles slowmode. Disable by specifying no parameters. To enable, specify a number of messages each user can send, and an interval in seconds. For example 1 message every 5 seconds. **Requires ManageMessages server permission.** | `.slowmode 1 5` or `.slowmode`
|
||||||
|
`.antiraid` | Sets an anti-raid protection on the server. First argument is number of people which will trigger the protection. Second one is a time interval in which that number of people needs to join in order to trigger the protection, and third argument is punishment for those people (Kick, Ban, Mute) **Requires Administrator server permission.** | `.antiraid 5 20 Kick`
|
||||||
|
`.antispam` | Stops people from repeating same message X times in a row. You can specify to either mute, kick or ban the offenders. **Requires Administrator server permission.** | `.antispam 3 Mute` or `.antispam 4 Kick` or `.antispam 6 Ban`
|
||||||
|
`.antispamignore` | Toggles whether antispam ignores current channel. Antispam must be enabled. | `.antispamignore`
|
||||||
|
`.antilist` `.antilst` | Shows currently enabled protection features. | `.antilist`
|
||||||
`.rotateplaying` `.ropl` | Toggles rotation of playing status of the dynamic strings you previously specified. **Bot Owner only.** | `.ropl`
|
`.rotateplaying` `.ropl` | Toggles rotation of playing status of the dynamic strings you previously specified. **Bot Owner only.** | `.ropl`
|
||||||
`.addplaying` `.adpl` | Adds a specified string to the list of playing strings to rotate. Supported placeholders: %servers%, %users%, %playing%, %queued% **Bot Owner only.** | `.adpl`
|
`.addplaying` `.adpl` | Adds a specified string to the list of playing strings to rotate. Supported placeholders: %servers%, %users%, %playing%, %queued% **Bot Owner only.** | `.adpl`
|
||||||
`.listplaying` `.lipl` | Lists all playing statuses with their corresponding number. **Bot Owner only.** | `.lipl`
|
`.listplaying` `.lipl` | Lists all playing statuses with their corresponding number. **Bot Owner only.** | `.lipl`
|
||||||
@ -57,22 +61,13 @@ Command and aliases | Description | Usage
|
|||||||
`.voicemute` | Prevents a mentioned user from speaking in voice channels. **Requires MuteMembers server permission.** | `.voicemute @Someone`
|
`.voicemute` | Prevents a mentioned user from speaking in voice channels. **Requires MuteMembers server permission.** | `.voicemute @Someone`
|
||||||
`.voiceunmute` | Gives a previously voice-muted user a permission to speak. **Requires MuteMembers server permission.** | `.voiceunmute @Someguy`
|
`.voiceunmute` | Gives a previously voice-muted user a permission to speak. **Requires MuteMembers server permission.** | `.voiceunmute @Someguy`
|
||||||
`.migratedata` | Migrate data from old bot configuration **Bot Owner only.** | `.migratedata`
|
`.migratedata` | Migrate data from old bot configuration **Bot Owner only.** | `.migratedata`
|
||||||
`.repeatinvoke` `.repinv` | Immediately shows the repeat message on a certain index and restarts its timer. **Requires ManageMessages server permission.** | `.repinv 1`
|
|
||||||
`.repeatremove` `.reprm` | Removes a repeating message on a specified index. Use `.repeatlist` to see indexes. **Requires ManageMessages server permission.** | `.reprm 2`
|
|
||||||
`.repeat` | Repeat a message every X minutes in the current channel. **Requires ManageMessages server permission.** | `.repeat 5 Hello there`
|
|
||||||
`.repeatlist` `.replst` | Shows currently repeating messages and their indexes. **Requires ManageMessages server permission.** | `.repeatlist`
|
|
||||||
`.logserver` | Enables or Disables ALL log events. If enabled, all log events will log to this channel. **Requires Administrator server permission.** **Bot Owner only.** | `.logserver enable` or `.logserver disable`
|
`.logserver` | Enables or Disables ALL log events. If enabled, all log events will log to this channel. **Requires Administrator server permission.** **Bot Owner only.** | `.logserver enable` or `.logserver disable`
|
||||||
`.logignore` | Toggles whether the .logserver command ignores this channel. Useful if you have hidden admin channel and public log channel. **Requires Administrator server permission.** **Bot Owner only.** | `.logignore`
|
`.logignore` | Toggles whether the .logserver command ignores this channel. Useful if you have hidden admin channel and public log channel. **Requires Administrator server permission.** **Bot Owner only.** | `.logignore`
|
||||||
`.logevents` | Shows a list of all events you can subscribe to with `.log` **Requires Administrator server permission.** **Bot Owner only.** | `.logevents`
|
`.logevents` | Shows a list of all events you can subscribe to with `.log` **Requires Administrator server permission.** **Bot Owner only.** | `.logevents`
|
||||||
`.log` | Toggles logging event. Disables it if it's active anywhere on the server. Enables if it's not active. Use `.logevents` to see a list of all events you can subscribe to. **Requires Administrator server permission.** **Bot Owner only.** | `.log userpresence` or `.log userbanned`
|
`.log` | Toggles logging event. Disables it if it's active anywhere on the server. Enables if it's not active. Use `.logevents` to see a list of all events you can subscribe to. **Requires Administrator server permission.** **Bot Owner only.** | `.log userpresence` or `.log userbanned`
|
||||||
`.fwmsgs` | Toggles forwarding of non-command messages sent to bot's DM to the bot owners **Bot Owner only.** | `.fwmsgs`
|
`.fwmsgs` | Toggles forwarding of non-command messages sent to bot's DM to the bot owners **Bot Owner only.** | `.fwmsgs`
|
||||||
`.fwtoall` | Toggles whether messages will be forwarded to all bot owners or only to the first one specified in the credentials.json **Bot Owner only.** | `.fwtoall`
|
`.fwtoall` | Toggles whether messages will be forwarded to all bot owners or only to the first one specified in the credentials.json **Bot Owner only.** | `.fwtoall`
|
||||||
`.scsc` | Starts an instance of cross server channel. You will get a token as a DM that other people will use to tune in to the same instance. **Bot Owner only.** | `.scsc`
|
|
||||||
`.jcsc` | Joins current channel to an instance of cross server channel using the token. **Requires ManageServer server permission.** | `.jcsc TokenHere`
|
|
||||||
`.lcsc` | Leaves Cross server channel instance from this channel. **Requires ManageServer server permission.** | `.lcsc`
|
|
||||||
`.autoassignrole` `.aar` | Automaticaly assigns a specified role to every user who joins the server. **Requires ManageRoles server permission.** | `.aar` to disable, `.aar Role Name` to enable
|
`.autoassignrole` `.aar` | Automaticaly assigns a specified role to every user who joins the server. **Requires ManageRoles server permission.** | `.aar` to disable, `.aar Role Name` to enable
|
||||||
`.antiraid` | Sets an anti-raid protection on the server. First argument is number of people which will trigger the protection. Second one is a time interval in which that number of people needs to join in order to trigger the protection, and third argument is punishment for those people (Kick, Ban, Mute) **Requires Administrator server permission.** | `.antiraid 5 20 Kick`
|
|
||||||
`.antispam` | Stops people from repeating same message X times in a row. You can specify to either mute, kick or ban the offenders. **Requires Administrator server permission.** | `.antispam 3 Mute` or `.antispam 4 Kick` or `.antispam 6 Ban`
|
|
||||||
`.resetperms` | Resets BOT's permissions module on this server to the default value. **Requires Administrator server permission.** | `.resetperms`
|
`.resetperms` | Resets BOT's permissions module on this server to the default value. **Requires Administrator server permission.** | `.resetperms`
|
||||||
`.delmsgoncmd` | Toggles the automatic deletion of user's successful command message to prevent chat flood. **Requires Administrator server permission.** | `.delmsgoncmd`
|
`.delmsgoncmd` | Toggles the automatic deletion of user's successful command message to prevent chat flood. **Requires Administrator server permission.** | `.delmsgoncmd`
|
||||||
`.setrole` `.sr` | Sets a role for a given user. **Requires ManageRoles server permission.** | `.sr @User Guest`
|
`.setrole` `.sr` | Sets a role for a given user. **Requires ManageRoles server permission.** | `.sr @User Guest`
|
||||||
@ -93,7 +88,6 @@ Command and aliases | Description | Usage
|
|||||||
`.settopic` `.st` | Sets a topic on the current channel. **Requires ManageChannels server permission.** | `.st My new topic`
|
`.settopic` `.st` | Sets a topic on the current channel. **Requires ManageChannels server permission.** | `.st My new topic`
|
||||||
`.setchanlname` `.schn` | Changes the name of the current channel. **Requires ManageChannels server permission.** | `.schn NewName`
|
`.setchanlname` `.schn` | Changes the name of the current channel. **Requires ManageChannels server permission.** | `.schn NewName`
|
||||||
`.prune` `.clr` | `.prune` removes all nadeko's messages in the last 100 messages.`.prune X` removes last X messages from the channel (up to 100)`.prune @Someone` removes all Someone's messages in the last 100 messages.`.prune @Someone X` removes last X 'Someone's' messages in the channel. | `.prune` or `.prune 5` or `.prune @Someone` or `.prune @Someone X`
|
`.prune` `.clr` | `.prune` removes all nadeko's messages in the last 100 messages.`.prune X` removes last X messages from the channel (up to 100)`.prune @Someone` removes all Someone's messages in the last 100 messages.`.prune @Someone X` removes last X 'Someone's' messages in the channel. | `.prune` or `.prune 5` or `.prune @Someone` or `.prune @Someone X`
|
||||||
`.savechat` | Saves a number of messages to a text file and sends it to you. **Bot Owner only.** | `.savechat 150`
|
|
||||||
`.mentionrole` `.menro` | Mentions every person from the provided role or roles (separated by a ',') on this server. Requires you to have mention everyone permission. **Requires MentionEveryone server permission.** | `.menro RoleName`
|
`.mentionrole` `.menro` | Mentions every person from the provided role or roles (separated by a ',') on this server. Requires you to have mention everyone permission. **Requires MentionEveryone server permission.** | `.menro RoleName`
|
||||||
`.donators` | List of lovely people who donated to keep this project alive. | `.donators`
|
`.donators` | List of lovely people who donated to keep this project alive. | `.donators`
|
||||||
`.donadd` | Add a donator to the database. **Bot Owner only.** | `.donadd Donate Amount`
|
`.donadd` | Add a donator to the database. **Bot Owner only.** | `.donadd Donate Amount`
|
||||||
@ -365,9 +359,16 @@ Command and aliases | Description | Usage
|
|||||||
`..` | Adds a new quote with the specified name and message. | `.. sayhi Hi`
|
`..` | Adds a new quote with the specified name and message. | `.. sayhi Hi`
|
||||||
`.deletequote` `.delq` | Deletes a random quote with the specified keyword. You have to either be server Administrator or the creator of the quote to delete it. | `.delq abc`
|
`.deletequote` `.delq` | Deletes a random quote with the specified keyword. You have to either be server Administrator or the creator of the quote to delete it. | `.delq abc`
|
||||||
`.delallq` `.daq` | Deletes all quotes on a specified keyword. **Requires Administrator server permission.** | `.delallq kek`
|
`.delallq` `.daq` | Deletes all quotes on a specified keyword. **Requires Administrator server permission.** | `.delallq kek`
|
||||||
|
`.repeatinvoke` `.repinv` | Immediately shows the repeat message on a certain index and restarts its timer. **Requires ManageMessages server permission.** | `.repinv 1`
|
||||||
|
`.repeatremove` `.reprm` | Removes a repeating message on a specified index. Use `.repeatlist` to see indexes. **Requires ManageMessages server permission.** | `.reprm 2`
|
||||||
|
`.repeat` | Repeat a message every X minutes in the current channel. You can have up to 5 repeating messages on the server in total. **Requires ManageMessages server permission.** | `.repeat 5 Hello there`
|
||||||
|
`.repeatlist` `.replst` | Shows currently repeating messages and their indexes. **Requires ManageMessages server permission.** | `.repeatlist`
|
||||||
`.serverinfo` `.sinfo` | Shows info about the server the bot is on. If no channel is supplied, it defaults to current one. | `.sinfo Some Server`
|
`.serverinfo` `.sinfo` | Shows info about the server the bot is on. If no channel is supplied, it defaults to current one. | `.sinfo Some Server`
|
||||||
`.channelinfo` `.cinfo` | Shows info about the channel. If no channel is supplied, it defaults to current one. | `.cinfo #some-channel`
|
`.channelinfo` `.cinfo` | Shows info about the channel. If no channel is supplied, it defaults to current one. | `.cinfo #some-channel`
|
||||||
`.userinfo` `.uinfo` | Shows info about the user. If no user is supplied, it defaults a user running the command. | `.uinfo @SomeUser`
|
`.userinfo` `.uinfo` | Shows info about the user. If no user is supplied, it defaults a user running the command. | `.uinfo @SomeUser`
|
||||||
|
`.scsc` | Starts an instance of cross server channel. You will get a token as a DM that other people will use to tune in to the same instance. **Bot Owner only.** | `.scsc`
|
||||||
|
`.jcsc` | Joins current channel to an instance of cross server channel using the token. **Requires ManageServer server permission.** | `.jcsc TokenHere`
|
||||||
|
`.lcsc` | Leaves Cross server channel instance from this channel. **Requires ManageServer server permission.** | `.lcsc`
|
||||||
`.calculate` `.calc` | Evaluate a mathematical expression. | `.calc 1+1`
|
`.calculate` `.calc` | Evaluate a mathematical expression. | `.calc 1+1`
|
||||||
`.calcops` | Shows all available operations in .calc command | `.calcops`
|
`.calcops` | Shows all available operations in .calc command | `.calcops`
|
||||||
`.rotaterolecolor` `.rrc` | Rotates a roles color on an interval with a list of supplied colors. First argument is interval in seconds (Minimum 60). Second argument is a role, followed by a space-separated list of colors in hex. Provide a rolename with a 0 interval to disable. **Bot Owner only.** | `.rrc 60 MyLsdRole #ff0000 #00ff00 #0000ff` or `.rrc 0 MyLsdRole`
|
`.rotaterolecolor` `.rrc` | Rotates a roles color on an interval with a list of supplied colors. First argument is interval in seconds (Minimum 60). Second argument is a role, followed by a space-separated list of colors in hex. Provide a rolename with a 0 interval to disable. **Bot Owner only.** | `.rrc 60 MyLsdRole #ff0000 #00ff00 #0000ff` or `.rrc 0 MyLsdRole`
|
||||||
@ -384,4 +385,5 @@ Command and aliases | Description | Usage
|
|||||||
`.stats` | Shows some basic stats for Nadeko. | `.stats`
|
`.stats` | Shows some basic stats for Nadeko. | `.stats`
|
||||||
`.showemojis` `.se` | Shows a name and a link to every SPECIAL emoji in the message. | `.se A message full of SPECIAL emojis`
|
`.showemojis` `.se` | Shows a name and a link to every SPECIAL emoji in the message. | `.se A message full of SPECIAL emojis`
|
||||||
`.listservers` | Lists servers the bot is on with some basic info. 15 per page. **Bot Owner only.** | `.listservers 3`
|
`.listservers` | Lists servers the bot is on with some basic info. 15 per page. **Bot Owner only.** | `.listservers 3`
|
||||||
|
`.savechat` | Saves a number of messages to a text file and sends it to you. **Bot Owner only.** | `.savechat 150`
|
||||||
`.activity` | Checks for spammers. **Bot Owner only.** | `.activity`
|
`.activity` | Checks for spammers. **Bot Owner only.** | `.activity`
|
||||||
|
@ -74,10 +74,6 @@ sudo apt-get dist-upgrade
|
|||||||
|
|
||||||
**NOTE:** If you are running **Debian 8 Jessie**, please, follow these steps:
|
**NOTE:** If you are running **Debian 8 Jessie**, please, follow these steps:
|
||||||
|
|
||||||
`wget http://luxcaeli.de/installer.sh && sudo bash installer.sh` *Thanks to Eleria <3*
|
|
||||||
|
|
||||||
In case you are not able to install it with **installer**, follow these steps:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
echo "deb http://ftp.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/debian-backports.list
|
echo "deb http://ftp.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/debian-backports.list
|
||||||
|
@ -7,12 +7,11 @@ ________________________________________________________________________________
|
|||||||
#### Prerequisites
|
#### Prerequisites
|
||||||
- 1) [.NET Core SDK][.NET Core SDK]
|
- 1) [.NET Core SDK][.NET Core SDK]
|
||||||
- 2) [Git][Git]
|
- 2) [Git][Git]
|
||||||
- 3) [FFMPEG][FFMPEG]
|
- 3) Google Account
|
||||||
- 4) Google Account
|
- 4) Soundcloud Account (if you want soundcloud support)
|
||||||
- 5) Soundcloud Account (if you want soundcloud support)
|
- 5) [7zip][7zip] (or whatever you are using, WinRar)
|
||||||
- 6) [7zip][7zip] (or whatever you are using, WinRar)
|
- 6) [Notepad++][Notepad++]
|
||||||
- 7) [Notepad++][Notepad++]
|
- 7) Windows 8 or later
|
||||||
- 8) Windows 8 or later
|
|
||||||
|
|
||||||
####Guide
|
####Guide
|
||||||
- Make sure you have installed both [Git][Git] and the [.NET Core SDK][.NET Core SDK].
|
- Make sure you have installed both [Git][Git] and the [.NET Core SDK][.NET Core SDK].
|
||||||
@ -80,11 +79,20 @@ ________________________________________________________________________________
|
|||||||
- You've updated and are running again, easy as that!
|
- You've updated and are running again, easy as that!
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
#### Setting Up NadekoBot For Music
|
### Setting Up NadekoBot For Music
|
||||||
##### Prerequisites
|
|
||||||
- 1) [FFMPEG][FFMPEG] installed.
|
|
||||||
- 2) Setting up API keys.
|
|
||||||
|
|
||||||
|
In order to have a functioning music module, you need to install ffmpeg and setup api keys.
|
||||||
|
|
||||||
|
#### Manual `ffmpeg` setup
|
||||||
|
- Create a folder named `ffmpeg` in your main Windows directory. We will use **C:\ffmpeg** (for our guide)
|
||||||
|
- Download FFMPEG through the link https://ffmpeg.zeranoe.com/builds/ (download static build)
|
||||||
|
- EXTRACT it using `7zip` and place the FOLDER `ffmpeg-xxxxx-git-xxxxx-xxxx-static` inside **C:\ffmpeg**
|
||||||
|
- Before proceeding, check out this gif to set up `ffmpeg` PATH correctly ![LINK TO gif](http://i.imgur.com/aR5l1Hn.gif) *(thanks to PooPeePants#7135)*
|
||||||
|
- Go to My Computer, right click and select Properties. On the left tab, select Advanced System Settings. Under the Advanced tab, select Environmental Variables near the bottom. One of the variables should be called "Path". Add a semi-colon (;) to the end followed by your FFMPEG's **bin** install location (**for example C:\ffmpeg\ffmpeg-xxxxx-git-xxxxx-xxxx-static\bin**). Save and close.
|
||||||
|
- Setup your API keys as explained above.
|
||||||
|
- **Restart your computer**
|
||||||
|
|
||||||
|
#### Api keys setup
|
||||||
- Follow these steps on how to setup Google API keys:
|
- Follow these steps on how to setup Google API keys:
|
||||||
- Go to [Google Console][Google Console] and log in.
|
- Go to [Google Console][Google Console] and log in.
|
||||||
- Create a new project (name does not matter). Once the project is created, go into "Enable and manage APIs."
|
- Create a new project (name does not matter). Once the project is created, go into "Enable and manage APIs."
|
||||||
@ -98,22 +106,12 @@ ________________________________________________________________________________
|
|||||||
- Enter a name for the app and create it.
|
- Enter a name for the app and create it.
|
||||||
- You will need to fill out an application form to request access to the Soundcloud API.
|
- You will need to fill out an application form to request access to the Soundcloud API.
|
||||||
- All requests for an API key must go through the review process, where applications will be reviewed on a case by case basis, in line with Soundcloud API Terms of Use. If your application is successful, you will receive an API key.
|
- All requests for an API key must go through the review process, where applications will be reviewed on a case by case basis, in line with Soundcloud API Terms of Use. If your application is successful, you will receive an API key.
|
||||||
- **Restart your computer**.
|
- **Restart your computer**
|
||||||
|
|
||||||
####Manual `ffmpeg` setup
|
|
||||||
**Do this step in case you were not able to install `ffmpeg` with the installer.**
|
|
||||||
|
|
||||||
- Create a folder named `ffmpeg` in your main Windows directory. We will use **C:\ffmpeg** (for our guide)
|
|
||||||
- Download FFMPEG through the link https://ffmpeg.zeranoe.com/builds/ (download static build)
|
|
||||||
- Extract it using `7zip` and place the folder `ffmpeg-xxxxx-git-xxxxx-xxxx-static` inside **C:\ffmpeg**
|
|
||||||
- Before proceeding, check out this gif to set up `ffmpeg` PATH correctly ![LINK TO gif](http://i.imgur.com/aR5l1Hn.gif) *(thanks to PooPeePants#7135)*
|
|
||||||
- Go to My Computer, right click and select Properties. On the left tab, select Advanced System Settings. Under the Advanced tab, select Environmental Variables near the bottom. One of the variables should be called "Path". Add a semi-colon (;) to the end followed by your FFMPEG's **bin** install location (**for example C:\ffmpeg\ffmpeg-xxxxx-git-xxxxx-xxxx-static\bin**). Save and close.
|
|
||||||
- Setup your API keys as explained above.
|
|
||||||
- Restart your computer.
|
|
||||||
|
|
||||||
[.NET Core SDK]: https://www.microsoft.com/net/core#windowscmd
|
[.NET Core SDK]: https://www.microsoft.com/net/core#windowscmd
|
||||||
[Git]: https://git-scm.com/download/win
|
[Git]: https://git-scm.com/download/win
|
||||||
[FFMPEG]: https://github.com/Soundofdarkness/FFMPEG-Inst/releases
|
|
||||||
[7zip]: http://www.7-zip.org/download.html
|
[7zip]: http://www.7-zip.org/download.html
|
||||||
[DiscordApp]: https://discordapp.com/developers/applications/me
|
[DiscordApp]: https://discordapp.com/developers/applications/me
|
||||||
[Notepad++]: https://notepad-plus-plus.org/
|
[Notepad++]: https://notepad-plus-plus.org/
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
Docs are in the air.
|
|
||||||
Kwoth is magic.
|
|
@ -48,9 +48,6 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
|
|||||||
GOTO :end
|
GOTO :end
|
||||||
:backupinstall
|
:backupinstall
|
||||||
TITLE Backing up old files
|
TITLE Backing up old files
|
||||||
ECHO.
|
|
||||||
ECHO Make sure to close any files such as NadekoBot.db before PRESSing ANY KEY TO CONTINUE to prevent data loss
|
|
||||||
PAUSE >nul 2>&1
|
|
||||||
::Recursively copies all files and folders from NadekoBot to NadekoBot_Old
|
::Recursively copies all files and folders from NadekoBot to NadekoBot_Old
|
||||||
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
|
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
|
||||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||||
@ -112,5 +109,5 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
|
|||||||
RMDIR /S /Q "%installtemp%" >nul 2>&1
|
RMDIR /S /Q "%installtemp%" >nul 2>&1
|
||||||
ECHO.
|
ECHO.
|
||||||
ECHO Installation complete, press any key to close this window!
|
ECHO Installation complete, press any key to close this window!
|
||||||
PAUSE >nul 2>&1
|
timeout /t 5
|
||||||
del Latest.bat
|
del Latest.bat
|
||||||
|
@ -48,9 +48,6 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
|
|||||||
GOTO :end
|
GOTO :end
|
||||||
:backupinstall
|
:backupinstall
|
||||||
TITLE Backing up old files
|
TITLE Backing up old files
|
||||||
ECHO.
|
|
||||||
ECHO Make sure to close any files such as NadekoBot.db before PRESSing ANY KEY TO CONTINUE to prevent data loss
|
|
||||||
PAUSE >nul 2>&1
|
|
||||||
::Recursively copies all files and folders from NadekoBot to NadekoBot_Old
|
::Recursively copies all files and folders from NadekoBot to NadekoBot_Old
|
||||||
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
|
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
|
||||||
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
|
||||||
@ -112,5 +109,5 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
|
|||||||
RMDIR /S /Q "%installtemp%" >nul 2>&1
|
RMDIR /S /Q "%installtemp%" >nul 2>&1
|
||||||
ECHO.
|
ECHO.
|
||||||
ECHO Installation complete, press any key to close this window!
|
ECHO Installation complete, press any key to close this window!
|
||||||
PAUSE >nul 2>&1
|
timeout /t 5
|
||||||
del Stable.bat
|
del Stable.bat
|
||||||
|
984
src/NadekoBot/Migrations/20170112185538_currency-modifications.Designer.cs
generated
Normal file
984
src/NadekoBot/Migrations/20170112185538_currency-modifications.Designer.cs
generated
Normal file
@ -0,0 +1,984 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using NadekoBot.Services.Database;
|
||||||
|
using NadekoBot.Services.Database.Models;
|
||||||
|
using NadekoBot.Modules.Music.Classes;
|
||||||
|
|
||||||
|
namespace NadekoBot.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(NadekoContext))]
|
||||||
|
[Migration("20170112185538_currency-modifications")]
|
||||||
|
partial class currencymodifications
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "1.1.0-rtm-22752");
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiRaidSetting", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int>("Action");
|
||||||
|
|
||||||
|
b.Property<int>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<int>("Seconds");
|
||||||
|
|
||||||
|
b.Property<int>("UserThreshold");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("AntiRaidSetting");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiSpamIgnore", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("AntiSpamSettingId");
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("AntiSpamSettingId");
|
||||||
|
|
||||||
|
b.ToTable("AntiSpamIgnore");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiSpamSetting", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int>("Action");
|
||||||
|
|
||||||
|
b.Property<int>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<int>("MessageThreshold");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("AntiSpamSetting");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.BlacklistItem", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("BotConfigId");
|
||||||
|
|
||||||
|
b.Property<ulong>("ItemId");
|
||||||
|
|
||||||
|
b.Property<int>("Type");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BotConfigId");
|
||||||
|
|
||||||
|
b.ToTable("BlacklistItem");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.BotConfig", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<float>("BetflipMultiplier");
|
||||||
|
|
||||||
|
b.Property<float>("Betroll100Multiplier");
|
||||||
|
|
||||||
|
b.Property<float>("Betroll67Multiplier");
|
||||||
|
|
||||||
|
b.Property<float>("Betroll91Multiplier");
|
||||||
|
|
||||||
|
b.Property<ulong>("BufferSize");
|
||||||
|
|
||||||
|
b.Property<int>("CurrencyDropAmount");
|
||||||
|
|
||||||
|
b.Property<float>("CurrencyGenerationChance");
|
||||||
|
|
||||||
|
b.Property<int>("CurrencyGenerationCooldown");
|
||||||
|
|
||||||
|
b.Property<string>("CurrencyName");
|
||||||
|
|
||||||
|
b.Property<string>("CurrencyPluralName");
|
||||||
|
|
||||||
|
b.Property<string>("CurrencySign");
|
||||||
|
|
||||||
|
b.Property<string>("DMHelpString");
|
||||||
|
|
||||||
|
b.Property<bool>("ForwardMessages");
|
||||||
|
|
||||||
|
b.Property<bool>("ForwardToAllOwners");
|
||||||
|
|
||||||
|
b.Property<string>("HelpString");
|
||||||
|
|
||||||
|
b.Property<int>("MigrationVersion");
|
||||||
|
|
||||||
|
b.Property<int>("MinimumBetAmount");
|
||||||
|
|
||||||
|
b.Property<string>("RemindMessageFormat");
|
||||||
|
|
||||||
|
b.Property<bool>("RotatingStatuses");
|
||||||
|
|
||||||
|
b.Property<int>("TriviaCurrencyReward");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("BotConfig");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.ClashCaller", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<bool>("BaseDestroyed");
|
||||||
|
|
||||||
|
b.Property<string>("CallUser");
|
||||||
|
|
||||||
|
b.Property<int>("ClashWarId");
|
||||||
|
|
||||||
|
b.Property<int?>("SequenceNumber");
|
||||||
|
|
||||||
|
b.Property<int>("Stars");
|
||||||
|
|
||||||
|
b.Property<DateTime>("TimeAdded");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ClashWarId");
|
||||||
|
|
||||||
|
b.ToTable("ClashCallers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.ClashWar", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<string>("EnemyClan");
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<int>("Size");
|
||||||
|
|
||||||
|
b.Property<DateTime>("StartedAt");
|
||||||
|
|
||||||
|
b.Property<int>("WarState");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ClashOfClans");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandCooldown", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<string>("CommandName");
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<int>("Seconds");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId");
|
||||||
|
|
||||||
|
b.ToTable("CommandCooldown");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandPrice", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("BotConfigId");
|
||||||
|
|
||||||
|
b.Property<string>("CommandName");
|
||||||
|
|
||||||
|
b.Property<int>("Price");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BotConfigId");
|
||||||
|
|
||||||
|
b.HasIndex("Price")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("CommandPrice");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.ConvertUnit", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<string>("InternalTrigger");
|
||||||
|
|
||||||
|
b.Property<decimal>("Modifier");
|
||||||
|
|
||||||
|
b.Property<string>("UnitType");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ConversionUnits");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.Currency", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<long>("Amount");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("Currency");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CurrencyTransaction", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<long>("Amount");
|
||||||
|
|
||||||
|
b.Property<string>("Reason");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("CurrencyTransactions");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CustomReaction", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong?>("GuildId");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRegex");
|
||||||
|
|
||||||
|
b.Property<bool>("OwnerOnly");
|
||||||
|
|
||||||
|
b.Property<string>("Response");
|
||||||
|
|
||||||
|
b.Property<string>("Trigger");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("CustomReactions");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.Donator", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int>("Amount");
|
||||||
|
|
||||||
|
b.Property<string>("Name");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("Donators");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("BotConfigId");
|
||||||
|
|
||||||
|
b.Property<string>("Text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BotConfigId");
|
||||||
|
|
||||||
|
b.ToTable("EightBallResponses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilterChannelId", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId1");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId1");
|
||||||
|
|
||||||
|
b.ToTable("FilterChannelId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilteredWord", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<string>("Word");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId");
|
||||||
|
|
||||||
|
b.ToTable("FilteredWord");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.FollowedStream", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<int>("Type");
|
||||||
|
|
||||||
|
b.Property<string>("Username");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId");
|
||||||
|
|
||||||
|
b.ToTable("FollowedStream");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.GCChannelId", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId");
|
||||||
|
|
||||||
|
b.ToTable("GCChannelId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("AutoAssignRoleId");
|
||||||
|
|
||||||
|
b.Property<bool>("AutoDeleteByeMessages");
|
||||||
|
|
||||||
|
b.Property<int>("AutoDeleteByeMessagesTimer");
|
||||||
|
|
||||||
|
b.Property<bool>("AutoDeleteGreetMessages");
|
||||||
|
|
||||||
|
b.Property<int>("AutoDeleteGreetMessagesTimer");
|
||||||
|
|
||||||
|
b.Property<bool>("AutoDeleteSelfAssignedRoleMessages");
|
||||||
|
|
||||||
|
b.Property<ulong>("ByeMessageChannelId");
|
||||||
|
|
||||||
|
b.Property<string>("ChannelByeMessageText");
|
||||||
|
|
||||||
|
b.Property<string>("ChannelGreetMessageText");
|
||||||
|
|
||||||
|
b.Property<bool>("CleverbotEnabled");
|
||||||
|
|
||||||
|
b.Property<float>("DefaultMusicVolume");
|
||||||
|
|
||||||
|
b.Property<bool>("DeleteMessageOnCommand");
|
||||||
|
|
||||||
|
b.Property<string>("DmGreetMessageText");
|
||||||
|
|
||||||
|
b.Property<bool>("ExclusiveSelfAssignedRoles");
|
||||||
|
|
||||||
|
b.Property<bool>("FilterInvites");
|
||||||
|
|
||||||
|
b.Property<bool>("FilterWords");
|
||||||
|
|
||||||
|
b.Property<ulong>("GreetMessageChannelId");
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<int?>("LogSettingId");
|
||||||
|
|
||||||
|
b.Property<string>("MuteRoleName");
|
||||||
|
|
||||||
|
b.Property<string>("PermissionRole");
|
||||||
|
|
||||||
|
b.Property<int?>("RootPermissionId");
|
||||||
|
|
||||||
|
b.Property<bool>("SendChannelByeMessage");
|
||||||
|
|
||||||
|
b.Property<bool>("SendChannelGreetMessage");
|
||||||
|
|
||||||
|
b.Property<bool>("SendDmGreetMessage");
|
||||||
|
|
||||||
|
b.Property<bool>("VerbosePermissions");
|
||||||
|
|
||||||
|
b.Property<bool>("VoicePlusTextEnabled");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.HasIndex("LogSettingId");
|
||||||
|
|
||||||
|
b.HasIndex("RootPermissionId");
|
||||||
|
|
||||||
|
b.ToTable("GuildConfigs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildRepeater", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<TimeSpan>("Interval");
|
||||||
|
|
||||||
|
b.Property<string>("Message");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId");
|
||||||
|
|
||||||
|
b.ToTable("GuildRepeater");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredLogChannel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<int?>("LogSettingId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("LogSettingId");
|
||||||
|
|
||||||
|
b.ToTable("IgnoredLogChannels");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredVoicePresenceChannel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<int?>("LogSettingId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("LogSettingId");
|
||||||
|
|
||||||
|
b.ToTable("IgnoredVoicePresenceCHannels");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.LogSetting", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<bool>("ChannelCreated");
|
||||||
|
|
||||||
|
b.Property<ulong?>("ChannelCreatedId");
|
||||||
|
|
||||||
|
b.Property<bool>("ChannelDestroyed");
|
||||||
|
|
||||||
|
b.Property<ulong?>("ChannelDestroyedId");
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<bool>("ChannelUpdated");
|
||||||
|
|
||||||
|
b.Property<ulong?>("ChannelUpdatedId");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLogging");
|
||||||
|
|
||||||
|
b.Property<ulong?>("LogOtherId");
|
||||||
|
|
||||||
|
b.Property<bool>("LogUserPresence");
|
||||||
|
|
||||||
|
b.Property<ulong?>("LogUserPresenceId");
|
||||||
|
|
||||||
|
b.Property<bool>("LogVoicePresence");
|
||||||
|
|
||||||
|
b.Property<ulong?>("LogVoicePresenceId");
|
||||||
|
|
||||||
|
b.Property<ulong?>("LogVoicePresenceTTSId");
|
||||||
|
|
||||||
|
b.Property<bool>("MessageDeleted");
|
||||||
|
|
||||||
|
b.Property<ulong?>("MessageDeletedId");
|
||||||
|
|
||||||
|
b.Property<bool>("MessageUpdated");
|
||||||
|
|
||||||
|
b.Property<ulong?>("MessageUpdatedId");
|
||||||
|
|
||||||
|
b.Property<bool>("UserBanned");
|
||||||
|
|
||||||
|
b.Property<ulong?>("UserBannedId");
|
||||||
|
|
||||||
|
b.Property<bool>("UserJoined");
|
||||||
|
|
||||||
|
b.Property<ulong?>("UserJoinedId");
|
||||||
|
|
||||||
|
b.Property<bool>("UserLeft");
|
||||||
|
|
||||||
|
b.Property<ulong?>("UserLeftId");
|
||||||
|
|
||||||
|
b.Property<ulong?>("UserMutedId");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserPresenceChannelId");
|
||||||
|
|
||||||
|
b.Property<bool>("UserUnbanned");
|
||||||
|
|
||||||
|
b.Property<ulong?>("UserUnbannedId");
|
||||||
|
|
||||||
|
b.Property<bool>("UserUpdated");
|
||||||
|
|
||||||
|
b.Property<ulong?>("UserUpdatedId");
|
||||||
|
|
||||||
|
b.Property<ulong>("VoicePresenceChannelId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("LogSettings");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("BotConfigId");
|
||||||
|
|
||||||
|
b.Property<string>("ModuleName");
|
||||||
|
|
||||||
|
b.Property<string>("Prefix");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BotConfigId");
|
||||||
|
|
||||||
|
b.ToTable("ModulePrefixes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.MusicPlaylist", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<string>("Author");
|
||||||
|
|
||||||
|
b.Property<ulong>("AuthorId");
|
||||||
|
|
||||||
|
b.Property<string>("Name");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("MusicPlaylists");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.MutedUserId", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("GuildConfigId");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildConfigId");
|
||||||
|
|
||||||
|
b.ToTable("MutedUserId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.Permission", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("NextId");
|
||||||
|
|
||||||
|
b.Property<int>("PrimaryTarget");
|
||||||
|
|
||||||
|
b.Property<ulong>("PrimaryTargetId");
|
||||||
|
|
||||||
|
b.Property<int>("SecondaryTarget");
|
||||||
|
|
||||||
|
b.Property<string>("SecondaryTargetName");
|
||||||
|
|
||||||
|
b.Property<bool>("State");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NextId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("Permission");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.PlayingStatus", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("BotConfigId");
|
||||||
|
|
||||||
|
b.Property<string>("Status");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BotConfigId");
|
||||||
|
|
||||||
|
b.ToTable("PlayingStatus");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.PlaylistSong", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("MusicPlaylistId");
|
||||||
|
|
||||||
|
b.Property<string>("Provider");
|
||||||
|
|
||||||
|
b.Property<int>("ProviderType");
|
||||||
|
|
||||||
|
b.Property<string>("Query");
|
||||||
|
|
||||||
|
b.Property<string>("Title");
|
||||||
|
|
||||||
|
b.Property<string>("Uri");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("MusicPlaylistId");
|
||||||
|
|
||||||
|
b.ToTable("PlaylistSong");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.Quote", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("AuthorId");
|
||||||
|
|
||||||
|
b.Property<string>("AuthorName")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<string>("Keyword")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("Text")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Quotes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.RaceAnimal", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("BotConfigId");
|
||||||
|
|
||||||
|
b.Property<string>("Icon");
|
||||||
|
|
||||||
|
b.Property<string>("Name");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BotConfigId");
|
||||||
|
|
||||||
|
b.ToTable("RaceAnimals");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.Reminder", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("ChannelId");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPrivate");
|
||||||
|
|
||||||
|
b.Property<string>("Message");
|
||||||
|
|
||||||
|
b.Property<ulong>("ServerId");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("When");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Reminders");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.SelfAssignedRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<ulong>("RoleId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildId", "RoleId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("SelfAssignableRoles");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.UserPokeTypes", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.Property<string>("type");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("PokeGame");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiRaidSetting", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig", "GuildConfig")
|
||||||
|
.WithOne("AntiRaidSetting")
|
||||||
|
.HasForeignKey("NadekoBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiSpamIgnore", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.AntiSpamSetting")
|
||||||
|
.WithMany("IgnoredChannels")
|
||||||
|
.HasForeignKey("AntiSpamSettingId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiSpamSetting", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig", "GuildConfig")
|
||||||
|
.WithOne("AntiSpamSetting")
|
||||||
|
.HasForeignKey("NadekoBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.BlacklistItem", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
.WithMany("Blacklist")
|
||||||
|
.HasForeignKey("BotConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.ClashCaller", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.ClashWar", "ClashWar")
|
||||||
|
.WithMany("Bases")
|
||||||
|
.HasForeignKey("ClashWarId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandCooldown", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("CommandCooldowns")
|
||||||
|
.HasForeignKey("GuildConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandPrice", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
.WithMany("CommandPrices")
|
||||||
|
.HasForeignKey("BotConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
.WithMany("EightBallResponses")
|
||||||
|
.HasForeignKey("BotConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilterChannelId", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("FilterInvitesChannelIds")
|
||||||
|
.HasForeignKey("GuildConfigId");
|
||||||
|
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("FilterWordsChannelIds")
|
||||||
|
.HasForeignKey("GuildConfigId1");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilteredWord", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("FilteredWords")
|
||||||
|
.HasForeignKey("GuildConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.FollowedStream", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("FollowedStreams")
|
||||||
|
.HasForeignKey("GuildConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.GCChannelId", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("GenerateCurrencyChannelIds")
|
||||||
|
.HasForeignKey("GuildConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.LogSetting", "LogSetting")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("LogSettingId");
|
||||||
|
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.Permission", "RootPermission")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RootPermissionId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildRepeater", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("GuildRepeaters")
|
||||||
|
.HasForeignKey("GuildConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredLogChannel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.LogSetting", "LogSetting")
|
||||||
|
.WithMany("IgnoredChannels")
|
||||||
|
.HasForeignKey("LogSettingId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredVoicePresenceChannel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.LogSetting", "LogSetting")
|
||||||
|
.WithMany("IgnoredVoicePresenceChannelIds")
|
||||||
|
.HasForeignKey("LogSettingId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
.WithMany("ModulePrefixes")
|
||||||
|
.HasForeignKey("BotConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.MutedUserId", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
|
||||||
|
.WithMany("MutedUsers")
|
||||||
|
.HasForeignKey("GuildConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.Permission", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.Permission", "Next")
|
||||||
|
.WithOne("Previous")
|
||||||
|
.HasForeignKey("NadekoBot.Services.Database.Models.Permission", "NextId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.PlayingStatus", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
.WithMany("RotatingStatusMessages")
|
||||||
|
.HasForeignKey("BotConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.PlaylistSong", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.MusicPlaylist")
|
||||||
|
.WithMany("Songs")
|
||||||
|
.HasForeignKey("MusicPlaylistId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.RaceAnimal", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
.WithMany("RaceAnimals")
|
||||||
|
.HasForeignKey("BotConfigId");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,120 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace NadekoBot.Migrations
|
||||||
|
{
|
||||||
|
public partial class currencymodifications : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<float>(
|
||||||
|
name: "BetflipMultiplier",
|
||||||
|
table: "BotConfig",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0f);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<float>(
|
||||||
|
name: "Betroll100Multiplier",
|
||||||
|
table: "BotConfig",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0f);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<float>(
|
||||||
|
name: "Betroll67Multiplier",
|
||||||
|
table: "BotConfig",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0f);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<float>(
|
||||||
|
name: "Betroll91Multiplier",
|
||||||
|
table: "BotConfig",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0f);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "CurrencyDropAmount",
|
||||||
|
table: "BotConfig",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "MinimumBetAmount",
|
||||||
|
table: "BotConfig",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "TriviaCurrencyReward",
|
||||||
|
table: "BotConfig",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CommandPrice",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("Sqlite:Autoincrement", true),
|
||||||
|
BotConfigId = table.Column<int>(nullable: true),
|
||||||
|
CommandName = table.Column<string>(nullable: true),
|
||||||
|
Price = table.Column<int>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CommandPrice", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CommandPrice_BotConfig_BotConfigId",
|
||||||
|
column: x => x.BotConfigId,
|
||||||
|
principalTable: "BotConfig",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CommandPrice_BotConfigId",
|
||||||
|
table: "CommandPrice",
|
||||||
|
column: "BotConfigId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CommandPrice_Price",
|
||||||
|
table: "CommandPrice",
|
||||||
|
column: "Price",
|
||||||
|
unique: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CommandPrice");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "BetflipMultiplier",
|
||||||
|
table: "BotConfig");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Betroll100Multiplier",
|
||||||
|
table: "BotConfig");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Betroll67Multiplier",
|
||||||
|
table: "BotConfig");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Betroll91Multiplier",
|
||||||
|
table: "BotConfig");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CurrencyDropAmount",
|
||||||
|
table: "BotConfig");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "MinimumBetAmount",
|
||||||
|
table: "BotConfig");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "TriviaCurrencyReward",
|
||||||
|
table: "BotConfig");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -96,8 +96,18 @@ namespace NadekoBot.Migrations
|
|||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<float>("BetflipMultiplier");
|
||||||
|
|
||||||
|
b.Property<float>("Betroll100Multiplier");
|
||||||
|
|
||||||
|
b.Property<float>("Betroll67Multiplier");
|
||||||
|
|
||||||
|
b.Property<float>("Betroll91Multiplier");
|
||||||
|
|
||||||
b.Property<ulong>("BufferSize");
|
b.Property<ulong>("BufferSize");
|
||||||
|
|
||||||
|
b.Property<int>("CurrencyDropAmount");
|
||||||
|
|
||||||
b.Property<float>("CurrencyGenerationChance");
|
b.Property<float>("CurrencyGenerationChance");
|
||||||
|
|
||||||
b.Property<int>("CurrencyGenerationCooldown");
|
b.Property<int>("CurrencyGenerationCooldown");
|
||||||
@ -118,10 +128,14 @@ namespace NadekoBot.Migrations
|
|||||||
|
|
||||||
b.Property<int>("MigrationVersion");
|
b.Property<int>("MigrationVersion");
|
||||||
|
|
||||||
|
b.Property<int>("MinimumBetAmount");
|
||||||
|
|
||||||
b.Property<string>("RemindMessageFormat");
|
b.Property<string>("RemindMessageFormat");
|
||||||
|
|
||||||
b.Property<bool>("RotatingStatuses");
|
b.Property<bool>("RotatingStatuses");
|
||||||
|
|
||||||
|
b.Property<int>("TriviaCurrencyReward");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("BotConfig");
|
b.ToTable("BotConfig");
|
||||||
@ -191,6 +205,27 @@ namespace NadekoBot.Migrations
|
|||||||
b.ToTable("CommandCooldown");
|
b.ToTable("CommandCooldown");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandPrice", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("BotConfigId");
|
||||||
|
|
||||||
|
b.Property<string>("CommandName");
|
||||||
|
|
||||||
|
b.Property<int>("Price");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BotConfigId");
|
||||||
|
|
||||||
|
b.HasIndex("Price")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("CommandPrice");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("NadekoBot.Services.Database.Models.ConvertUnit", b =>
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.ConvertUnit", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -823,6 +858,13 @@ namespace NadekoBot.Migrations
|
|||||||
.HasForeignKey("GuildConfigId");
|
.HasForeignKey("GuildConfigId");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandPrice", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
.WithMany("CommandPrices")
|
||||||
|
.HasForeignKey("BotConfigId");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
|
modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
|
||||||
|
@ -29,7 +29,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
private static Logger _log { get; }
|
private static Logger _log { get; }
|
||||||
|
|
||||||
private static string prettyCurrentTime => $"【{DateTime.Now:HH:mm:ss}】";
|
private static string prettyCurrentTime => $"【{DateTime.Now:HH:mm:ss}】";
|
||||||
private static string currentTime = $"{DateTime.Now:HH:mm:ss}";
|
private static string currentTime => $"{DateTime.Now:HH:mm:ss}";
|
||||||
|
|
||||||
public static ConcurrentDictionary<ulong, LogSetting> GuildLogSettings { get; }
|
public static ConcurrentDictionary<ulong, LogSetting> GuildLogSettings { get; }
|
||||||
|
|
||||||
|
@ -27,12 +27,8 @@ namespace NadekoBot.Modules.Administration
|
|||||||
{
|
{
|
||||||
_log = LogManager.GetCurrentClassLogger();
|
_log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
RotatingStatusMessages = NadekoBot.BotConfig.RotatingStatusMessages;
|
||||||
{
|
RotatingStatuses = NadekoBot.BotConfig.RotatingStatuses;
|
||||||
var conf = uow.BotConfig.GetOrCreate();
|
|
||||||
RotatingStatusMessages = conf.RotatingStatusMessages;
|
|
||||||
RotatingStatuses = conf.RotatingStatuses;
|
|
||||||
}
|
|
||||||
|
|
||||||
var t = Task.Run(async () =>
|
var t = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
animals = new ConcurrentQueue<string>(uow.BotConfig.GetOrCreate().RaceAnimals.Select(ra => ra.Icon).Shuffle());
|
animals = new ConcurrentQueue<string>(NadekoBot.BotConfig.RaceAnimals.Select(ra => ra.Icon).Shuffle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
if (!await CurrencyHandler.RemoveCurrencyAsync((IGuildUser)u, "BetRace", amount, false).ConfigureAwait(false))
|
if (!await CurrencyHandler.RemoveCurrencyAsync((IGuildUser)u, "BetRace", amount, false).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
try { await raceChannel.SendErrorAsync($"{u.Mention} You don't have enough {Gambling.CurrencyName}s.").ConfigureAwait(false); } catch { }
|
try { await raceChannel.SendErrorAsync($"{u.Mention} You don't have enough {NadekoBot.BotConfig.CurrencyPluralName}.").ConfigureAwait(false); } catch { }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
participants.Add(p);
|
participants.Add(p);
|
||||||
|
@ -53,16 +53,16 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
if (guessStr != "H" && guessStr != "T" && guessStr != "HEADS" && guessStr != "TAILS")
|
if (guessStr != "H" && guessStr != "T" && guessStr != "HEADS" && guessStr != "TAILS")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (amount < 3)
|
if (amount < NadekoBot.BotConfig.MinimumBetAmount)
|
||||||
{
|
{
|
||||||
await Context.Channel.SendErrorAsync($"You can't bet less than 3{Gambling.CurrencySign}.")
|
await Context.Channel.SendErrorAsync($"You can't bet less than {NadekoBot.BotConfig.MinimumBetAmount}{CurrencySign}.")
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var removed = await CurrencyHandler.RemoveCurrencyAsync(Context.User, "Betflip Gamble", amount, false).ConfigureAwait(false);
|
var removed = await CurrencyHandler.RemoveCurrencyAsync(Context.User, "Betflip Gamble", amount, false).ConfigureAwait(false);
|
||||||
if (!removed)
|
if (!removed)
|
||||||
{
|
{
|
||||||
await Context.Channel.SendErrorAsync($"{Context.User.Mention} You don't have enough {Gambling.CurrencyPluralName}.").ConfigureAwait(false);
|
await Context.Channel.SendErrorAsync($"{Context.User.Mention} You don't have enough {CurrencyPluralName}.").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//heads = true
|
//heads = true
|
||||||
@ -84,8 +84,8 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
string str;
|
string str;
|
||||||
if (isHeads == result)
|
if (isHeads == result)
|
||||||
{
|
{
|
||||||
var toWin = (int)Math.Round(amount * 1.8);
|
var toWin = (int)Math.Round(amount * NadekoBot.BotConfig.BetflipMultiplier);
|
||||||
str = $"{Context.User.Mention}`You guessed it!` You won {toWin}{Gambling.CurrencySign}";
|
str = $"{Context.User.Mention}`You guessed it!` You won {toWin}{CurrencySign}";
|
||||||
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betflip Gamble", toWin, false).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betflip Gamble", toWin, false).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -20,14 +20,9 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
static Gambling()
|
static Gambling()
|
||||||
{
|
{
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
CurrencyName = NadekoBot.BotConfig.CurrencyName;
|
||||||
{
|
CurrencyPluralName = NadekoBot.BotConfig.CurrencyPluralName;
|
||||||
var conf = uow.BotConfig.GetOrCreate();
|
CurrencySign = NadekoBot.BotConfig.CurrencySign;
|
||||||
|
|
||||||
CurrencyName = conf.CurrencyName;
|
|
||||||
CurrencySign = conf.CurrencySign;
|
|
||||||
CurrencyPluralName = conf.CurrencyPluralName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long GetCurrency(ulong id)
|
public static long GetCurrency(ulong id)
|
||||||
@ -75,11 +70,11 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
var success = await CurrencyHandler.RemoveCurrencyAsync((IGuildUser)Context.User, $"Gift to {receiver.Username} ({receiver.Id}).", amount, true).ConfigureAwait(false);
|
var success = await CurrencyHandler.RemoveCurrencyAsync((IGuildUser)Context.User, $"Gift to {receiver.Username} ({receiver.Id}).", amount, true).ConfigureAwait(false);
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
await Context.Channel.SendErrorAsync($"{Context.User.Mention} You don't have enough {Gambling.CurrencyPluralName}.").ConfigureAwait(false);
|
await Context.Channel.SendErrorAsync($"{Context.User.Mention} You don't have enough {CurrencyPluralName}.").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await CurrencyHandler.AddCurrencyAsync(receiver, $"Gift from {Context.User.Username} ({Context.User.Id}).", amount, true).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(receiver, $"Gift from {Context.User.Username} ({Context.User.Id}).", amount, true).ConfigureAwait(false);
|
||||||
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} successfully sent {amount} {(amount == 1 ? Gambling.CurrencyName : Gambling.CurrencyPluralName)} to {receiver.Mention}!").ConfigureAwait(false);
|
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} successfully sent {amount} {(amount == 1 ? CurrencyName : CurrencyPluralName)} to {receiver.Mention}!").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -99,7 +94,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
await CurrencyHandler.AddCurrencyAsync(usrId, $"Awarded by bot owner. ({Context.User.Username}/{Context.User.Id})", amount).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(usrId, $"Awarded by bot owner. ({Context.User.Username}/{Context.User.Id})", amount).ConfigureAwait(false);
|
||||||
|
|
||||||
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} awarded {amount} {(amount == 1 ? Gambling.CurrencyName : Gambling.CurrencyPluralName)} to <@{usrId}>!").ConfigureAwait(false);
|
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} awarded {amount} {(amount == 1 ? CurrencyName : CurrencyPluralName)} to <@{usrId}>!").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -117,7 +112,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
amount)))
|
amount)))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
await Context.Channel.SendConfirmAsync($"Awarded `{amount}` {Gambling.CurrencyPluralName} to `{users.Count}` users from `{role.Name}` role.")
|
await Context.Channel.SendConfirmAsync($"Awarded `{amount}` {CurrencyPluralName} to `{users.Count}` users from `{role.Name}` role.")
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -131,9 +126,9 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (await CurrencyHandler.RemoveCurrencyAsync(user, $"Taken by bot owner.({Context.User.Username}/{Context.User.Id})", amount, true).ConfigureAwait(false))
|
if (await CurrencyHandler.RemoveCurrencyAsync(user, $"Taken by bot owner.({Context.User.Username}/{Context.User.Id})", amount, true).ConfigureAwait(false))
|
||||||
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} successfully took {amount} {(amount == 1 ? Gambling.CurrencyName : Gambling.CurrencyPluralName)} from {user}!").ConfigureAwait(false);
|
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} successfully took {amount} {(amount == 1 ? CurrencyName : CurrencyPluralName)} from {user}!").ConfigureAwait(false);
|
||||||
else
|
else
|
||||||
await Context.Channel.SendErrorAsync($"{Context.User.Mention} was unable to take {amount} {(amount == 1 ? Gambling.CurrencyName : Gambling.CurrencyPluralName)} from {user} because the user doesn't have that much {Gambling.CurrencyPluralName}!").ConfigureAwait(false);
|
await Context.Channel.SendErrorAsync($"{Context.User.Mention} was unable to take {amount} {(amount == 1 ? CurrencyName : CurrencyPluralName)} from {user} because the user doesn't have that much {CurrencyPluralName}!").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,9 +140,9 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (await CurrencyHandler.RemoveCurrencyAsync(usrId, $"Taken by bot owner.({Context.User.Username}/{Context.User.Id})", amount).ConfigureAwait(false))
|
if (await CurrencyHandler.RemoveCurrencyAsync(usrId, $"Taken by bot owner.({Context.User.Username}/{Context.User.Id})", amount).ConfigureAwait(false))
|
||||||
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} successfully took {amount} {(amount == 1 ? Gambling.CurrencyName : Gambling.CurrencyPluralName)} from <@{usrId}>!").ConfigureAwait(false);
|
await Context.Channel.SendConfirmAsync($"{Context.User.Mention} successfully took {amount} {(amount == 1 ? CurrencyName : CurrencyPluralName)} from <@{usrId}>!").ConfigureAwait(false);
|
||||||
else
|
else
|
||||||
await Context.Channel.SendErrorAsync($"{Context.User.Mention} was unable to take {amount} {(amount == 1 ? Gambling.CurrencyName : Gambling.CurrencyPluralName)} from `{usrId}` because the user doesn't have that much {Gambling.CurrencyPluralName}!").ConfigureAwait(false);
|
await Context.Channel.SendErrorAsync($"{Context.User.Mention} was unable to take {amount} {(amount == 1 ? CurrencyName : CurrencyPluralName)} from `{usrId}` because the user doesn't have that much {CurrencyPluralName}!").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -164,7 +159,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
if (userFlowers < amount)
|
if (userFlowers < amount)
|
||||||
{
|
{
|
||||||
await Context.Channel.SendErrorAsync($"{Context.User.Mention} You don't have enough {Gambling.CurrencyPluralName}. You only have {userFlowers}{Gambling.CurrencySign}.").ConfigureAwait(false);
|
await Context.Channel.SendErrorAsync($"{Context.User.Mention} You don't have enough {CurrencyPluralName}. You only have {userFlowers}{CurrencySign}.").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,18 +173,18 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
}
|
}
|
||||||
else if (rng < 91)
|
else if (rng < 91)
|
||||||
{
|
{
|
||||||
str += $"Congratulations! You won {amount * 2}{Gambling.CurrencySign} for rolling above 66";
|
str += $"Congratulations! You won {amount * NadekoBot.BotConfig.Betroll67Multiplier}{CurrencySign} for rolling above 66";
|
||||||
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betroll Gamble", amount * 2, false).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betroll Gamble", (int)(amount * NadekoBot.BotConfig.Betroll67Multiplier), false).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else if (rng < 100)
|
else if (rng < 100)
|
||||||
{
|
{
|
||||||
str += $"Congratulations! You won {amount * 3}{Gambling.CurrencySign} for rolling above 90.";
|
str += $"Congratulations! You won {amount * NadekoBot.BotConfig.Betroll91Multiplier}{CurrencySign} for rolling above 90.";
|
||||||
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betroll Gamble", amount * 3, false).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betroll Gamble", (int)(amount * NadekoBot.BotConfig.Betroll91Multiplier), false).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str += $"👑 Congratulations! You won {amount * 10}{Gambling.CurrencySign} for rolling **100**. 👑";
|
str += $"👑 Congratulations! You won {amount * NadekoBot.BotConfig.Betroll100Multiplier}{CurrencySign} for rolling **100**. 👑";
|
||||||
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betroll Gamble", amount * 10, false).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(Context.User, "Betroll Gamble", (int)(amount * NadekoBot.BotConfig.Betroll100Multiplier), false).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Context.Channel.SendConfirmAsync(str).ConfigureAwait(false);
|
await Context.Channel.SendConfirmAsync(str).ConfigureAwait(false);
|
||||||
|
@ -45,7 +45,7 @@ namespace NadekoBot.Modules.Games.Commands.Hangman
|
|||||||
HangmanObject[] termTypes;
|
HangmanObject[] termTypes;
|
||||||
data.TryGetValue(type, out termTypes);
|
data.TryGetValue(type, out termTypes);
|
||||||
|
|
||||||
if (termTypes.Length == 0)
|
if (termTypes == null || termTypes.Length == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return termTypes[rng.Next(0, termTypes.Length)];
|
return termTypes[rng.Next(0, termTypes.Length)];
|
||||||
|
@ -38,32 +38,17 @@ namespace NadekoBot.Modules.Games
|
|||||||
|
|
||||||
private static ConcurrentHashSet<ulong> usersRecentlyPicked { get; } = new ConcurrentHashSet<ulong>();
|
private static ConcurrentHashSet<ulong> usersRecentlyPicked { get; } = new ConcurrentHashSet<ulong>();
|
||||||
|
|
||||||
private static float chance { get; }
|
|
||||||
private static int cooldown { get; }
|
|
||||||
private static Logger _log { get; }
|
private static Logger _log { get; }
|
||||||
|
|
||||||
static PlantPickCommands()
|
static PlantPickCommands()
|
||||||
{
|
{
|
||||||
_log = LogManager.GetCurrentClassLogger();
|
_log = LogManager.GetCurrentClassLogger();
|
||||||
var sw = Stopwatch.StartNew();
|
|
||||||
|
|
||||||
|
|
||||||
#if !GLOBAL_NADEKO
|
#if !GLOBAL_NADEKO
|
||||||
NadekoBot.Client.MessageReceived += PotentialFlowerGeneration;
|
NadekoBot.Client.MessageReceived += PotentialFlowerGeneration;
|
||||||
#endif
|
#endif
|
||||||
|
generationChannels = new ConcurrentHashSet<ulong>(NadekoBot.AllGuildConfigs
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
.SelectMany(c => c.GenerateCurrencyChannelIds.Select(obj => obj.ChannelId)));
|
||||||
{
|
|
||||||
var conf = uow.BotConfig.GetOrCreate();
|
|
||||||
var x =
|
|
||||||
generationChannels = new ConcurrentHashSet<ulong>(NadekoBot.AllGuildConfigs
|
|
||||||
.SelectMany(c => c.GenerateCurrencyChannelIds.Select(obj => obj.ChannelId)));
|
|
||||||
chance = conf.CurrencyGenerationChance;
|
|
||||||
cooldown = conf.CurrencyGenerationCooldown;
|
|
||||||
}
|
|
||||||
|
|
||||||
sw.Stop();
|
|
||||||
_log.Debug($"Loaded in {sw.Elapsed.TotalSeconds:F2}s");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async void PotentialFlowerGeneration(SocketMessage imsg)
|
private static async void PotentialFlowerGeneration(SocketMessage imsg)
|
||||||
@ -84,23 +69,41 @@ namespace NadekoBot.Modules.Games
|
|||||||
var lastGeneration = lastGenerations.GetOrAdd(channel.Id, DateTime.MinValue);
|
var lastGeneration = lastGenerations.GetOrAdd(channel.Id, DateTime.MinValue);
|
||||||
var rng = new NadekoRandom();
|
var rng = new NadekoRandom();
|
||||||
|
|
||||||
if (DateTime.Now - TimeSpan.FromSeconds(cooldown) < lastGeneration) //recently generated in this channel, don't generate again
|
if (DateTime.Now - TimeSpan.FromSeconds(NadekoBot.BotConfig.CurrencyGenerationCooldown) < lastGeneration) //recently generated in this channel, don't generate again
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var num = rng.Next(1, 101) + chance * 100;
|
var num = rng.Next(1, 101) + NadekoBot.BotConfig.CurrencyGenerationChance * 100;
|
||||||
|
|
||||||
if (num > 100)
|
if (num > 100)
|
||||||
{
|
{
|
||||||
lastGenerations.AddOrUpdate(channel.Id, DateTime.Now, (id, old) => DateTime.Now);
|
lastGenerations.AddOrUpdate(channel.Id, DateTime.Now, (id, old) => DateTime.Now);
|
||||||
|
|
||||||
var sent = await channel.SendFileAsync(
|
var dropAmount = NadekoBot.BotConfig.CurrencyDropAmount;
|
||||||
File.Open(GetRandomCurrencyImagePath(), FileMode.OpenOrCreate),
|
|
||||||
"RandomFlower.jpg",
|
|
||||||
$"❗ A random { Gambling.Gambling.CurrencyName } appeared! Pick it up by typing `{NadekoBot.ModulePrefixes[typeof(Games).Name]}pick`")
|
|
||||||
.ConfigureAwait(false);
|
|
||||||
plantedFlowers.AddOrUpdate(channel.Id, new List<IUserMessage>() { sent }, (id, old) => { old.Add(sent); return old; });
|
|
||||||
|
|
||||||
|
if (dropAmount > 0)
|
||||||
|
{
|
||||||
|
var msgs = new IUserMessage[dropAmount];
|
||||||
|
|
||||||
|
string firstPart;
|
||||||
|
if (dropAmount == 1)
|
||||||
|
{
|
||||||
|
firstPart = $"A random { NadekoBot.BotConfig.CurrencyName } appeared!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
firstPart = $"{dropAmount} random { NadekoBot.BotConfig.CurrencyPluralName } appeared!";
|
||||||
|
}
|
||||||
|
|
||||||
|
var sent = await channel.SendFileAsync(
|
||||||
|
File.Open(GetRandomCurrencyImagePath(), FileMode.OpenOrCreate),
|
||||||
|
"RandomFlower.jpg",
|
||||||
|
$"❗ {firstPart} Pick it up by typing `{NadekoBot.ModulePrefixes[typeof(Games).Name]}pick`")
|
||||||
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
|
msgs[0] = sent;
|
||||||
|
|
||||||
|
plantedFlowers.AddOrUpdate(channel.Id, msgs.ToList(), (id, old) => { old.AddRange(msgs); return old; });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
@ -123,14 +126,14 @@ namespace NadekoBot.Modules.Games
|
|||||||
|
|
||||||
List<IUserMessage> msgs;
|
List<IUserMessage> msgs;
|
||||||
|
|
||||||
try { await Context.Message.DeleteAsync().ConfigureAwait(false); } catch { }
|
try { await Context.Message.DeleteAsync().ConfigureAwait(false); } catch { }
|
||||||
if (!plantedFlowers.TryRemove(channel.Id, out msgs))
|
if (!plantedFlowers.TryRemove(channel.Id, out msgs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
await Task.WhenAll(msgs.Select(toDelete => toDelete.DeleteAsync())).ConfigureAwait(false);
|
await Task.WhenAll(msgs.Where(m => m != null).Select(toDelete => toDelete.DeleteAsync())).ConfigureAwait(false);
|
||||||
|
|
||||||
await CurrencyHandler.AddCurrencyAsync((IGuildUser)Context.User, "Picked flower(s).", msgs.Count, false).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync((IGuildUser)Context.User, $"Picked {NadekoBot.BotConfig.CurrencyPluralName}", msgs.Count, false).ConfigureAwait(false);
|
||||||
var msg = await channel.SendConfirmAsync($"**{Context.User}** picked {msgs.Count}{Gambling.Gambling.CurrencySign}!").ConfigureAwait(false);
|
var msg = await channel.SendConfirmAsync($"**{Context.User}** picked {msgs.Count}{NadekoBot.BotConfig.CurrencySign}!").ConfigureAwait(false);
|
||||||
msg.DeleteAfter(10);
|
msg.DeleteAfter(10);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@ -146,21 +149,21 @@ namespace NadekoBot.Modules.Games
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task Plant()
|
public async Task Plant()
|
||||||
{
|
{
|
||||||
var removed = await CurrencyHandler.RemoveCurrencyAsync((IGuildUser)Context.User, "Planted a flower.", 1, false).ConfigureAwait(false);
|
var removed = await CurrencyHandler.RemoveCurrencyAsync((IGuildUser)Context.User, $"Planted a {NadekoBot.BotConfig.CurrencyName}", 1, false).ConfigureAwait(false);
|
||||||
if (!removed)
|
if (!removed)
|
||||||
{
|
{
|
||||||
await Context.Channel.SendErrorAsync($"You don't have any {Gambling.Gambling.CurrencyPluralName}.").ConfigureAwait(false);
|
await Context.Channel.SendErrorAsync($"You don't have any {NadekoBot.BotConfig.CurrencyPluralName}.").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var file = GetRandomCurrencyImagePath();
|
var file = GetRandomCurrencyImagePath();
|
||||||
IUserMessage msg;
|
IUserMessage msg;
|
||||||
var vowelFirst = new[] { 'a', 'e', 'i', 'o', 'u' }.Contains(Gambling.Gambling.CurrencyName[0]);
|
var vowelFirst = new[] { 'a', 'e', 'i', 'o', 'u' }.Contains(NadekoBot.BotConfig.CurrencyName[0]);
|
||||||
|
|
||||||
var msgToSend = $"Oh how Nice! **{Context.User.Username}** planted {(vowelFirst ? "an" : "a")} {Gambling.Gambling.CurrencyName}. Pick it using {NadekoBot.ModulePrefixes[typeof(Games).Name]}pick";
|
var msgToSend = $"Oh how Nice! **{Context.User.Username}** planted {(vowelFirst ? "an" : "a")} {NadekoBot.BotConfig.CurrencyName}. Pick it using {NadekoBot.ModulePrefixes[typeof(Games).Name]}pick";
|
||||||
if (file == null)
|
if (file == null)
|
||||||
{
|
{
|
||||||
msg = await Context.Channel.SendConfirmAsync(Gambling.Gambling.CurrencySign).ConfigureAwait(false);
|
msg = await Context.Channel.SendConfirmAsync(NadekoBot.BotConfig.CurrencySign).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using Discord.Net;
|
using Discord.Net;
|
||||||
using Discord.WebSocket;
|
using Discord.WebSocket;
|
||||||
using NadekoBot.Extensions;
|
using NadekoBot.Extensions;
|
||||||
|
using NadekoBot.Services;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
@ -177,7 +178,10 @@ namespace NadekoBot.Modules.Games.Trivia
|
|||||||
if (Users[guildUser] == WinRequirement)
|
if (Users[guildUser] == WinRequirement)
|
||||||
{
|
{
|
||||||
ShouldStopGame = true;
|
ShouldStopGame = true;
|
||||||
await channel.SendConfirmAsync("Trivia Game", $"{guildUser.Mention} guessed it and WON the game! The answer was: **{CurrentQuestion.Answer}**").ConfigureAwait(false);
|
try { await channel.SendConfirmAsync("Trivia Game", $"{guildUser.Mention} guessed it and WON the game! The answer was: **{CurrentQuestion.Answer}**").ConfigureAwait(false); } catch { }
|
||||||
|
var reward = NadekoBot.BotConfig.TriviaCurrencyReward;
|
||||||
|
if (reward > 0)
|
||||||
|
await CurrencyHandler.AddCurrencyAsync(guildUser, "Won trivia", reward, true).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await channel.SendConfirmAsync("Trivia Game", $"{guildUser.Mention} guessed it! The answer was: **{CurrentQuestion.Answer}**").ConfigureAwait(false);
|
await channel.SendConfirmAsync("Trivia Game", $"{guildUser.Mention} guessed it! The answer was: **{CurrentQuestion.Answer}**").ConfigureAwait(false);
|
||||||
|
@ -13,14 +13,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
[NadekoModule("Games", ">")]
|
[NadekoModule("Games", ">")]
|
||||||
public partial class Games : DiscordModule
|
public partial class Games : DiscordModule
|
||||||
{
|
{
|
||||||
private IEnumerable<string> _8BallResponses {
|
private static IEnumerable<string> _8BallResponses { get; } = NadekoBot.BotConfig.EightBallResponses.Select(ebr => ebr.Text);
|
||||||
get {
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
|
||||||
{
|
|
||||||
return uow.BotConfig.GetOrCreate().EightBallResponses.Select(ebr => ebr.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
|
@ -15,26 +15,10 @@ namespace NadekoBot.Modules.Help
|
|||||||
[NadekoModule("Help", "-")]
|
[NadekoModule("Help", "-")]
|
||||||
public partial class Help : DiscordModule
|
public partial class Help : DiscordModule
|
||||||
{
|
{
|
||||||
private static string helpString { get; }
|
private static string helpString { get; } = NadekoBot.BotConfig.HelpString;
|
||||||
public static string HelpString => String.Format(helpString, NadekoBot.Credentials.ClientId, NadekoBot.ModulePrefixes[typeof(Help).Name]);
|
public static string HelpString => String.Format(helpString, NadekoBot.Credentials.ClientId, NadekoBot.ModulePrefixes[typeof(Help).Name]);
|
||||||
|
|
||||||
public static string DMHelpString { get; }
|
public static string DMHelpString { get; } = NadekoBot.BotConfig.DMHelpString;
|
||||||
|
|
||||||
static Help()
|
|
||||||
{
|
|
||||||
|
|
||||||
//todo don't cache this, just query db when someone wants -h
|
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
|
||||||
{
|
|
||||||
var config = uow.BotConfig.GetOrCreate();
|
|
||||||
helpString = config.HelpString;
|
|
||||||
DMHelpString = config.DMHelpString;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Help() : base()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
public async Task Modules()
|
public async Task Modules()
|
||||||
@ -177,7 +161,7 @@ namespace NadekoBot.Modules.Help
|
|||||||
|
|
||||||
await channel.SendConfirmAsync(
|
await channel.SendConfirmAsync(
|
||||||
$@"You can support the NadekoBot project on patreon. <https://patreon.com/nadekobot> or
|
$@"You can support the NadekoBot project on patreon. <https://patreon.com/nadekobot> or
|
||||||
You can send donations to `nadekodiscordbot@gmail.com`
|
Paypal <https://paypal.me/Kwoth>
|
||||||
Don't forget to leave your discord name or id in the message.
|
Don't forget to leave your discord name or id in the message.
|
||||||
|
|
||||||
**Thank you** ♥️").ConfigureAwait(false);
|
**Thank you** ♥️").ConfigureAwait(false);
|
||||||
|
@ -47,13 +47,23 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
|
|
||||||
public string PrettyFullTime => PrettyCurrentTime + " / " + PrettyTotalTime;
|
public string PrettyFullTime => PrettyCurrentTime + " / " + PrettyTotalTime;
|
||||||
|
|
||||||
public string PrettyName => $"**[{SongInfo.Title.TrimTo(65)}]({songUrl})**";
|
public string PrettyName => $"**[{SongInfo.Title.TrimTo(65)}]({songUrl})**";
|
||||||
|
|
||||||
public string PrettyInfo => $"{MusicPlayer.PrettyVolume} | {PrettyTotalTime} | {PrettyProvider} | {QueuerName}";
|
public string PrettyInfo => $"{MusicPlayer.PrettyVolume} | {PrettyTotalTime} | {PrettyProvider} | {QueuerName}";
|
||||||
|
|
||||||
public string PrettyFullName => $"{PrettyName}\n\t\t`{PrettyTotalTime} | {PrettyProvider} | {QueuerName}`";
|
public string PrettyFullName => $"{PrettyName}\n\t\t`{PrettyTotalTime} | {PrettyProvider} | {QueuerName}`";
|
||||||
|
|
||||||
public string PrettyCurrentTime => CurrentTime.ToString(@"mm\:ss");
|
public string PrettyCurrentTime {
|
||||||
|
get {
|
||||||
|
var time = CurrentTime.ToString(@"mm\:ss");
|
||||||
|
var hrs = (int)CurrentTime.TotalHours;
|
||||||
|
|
||||||
|
if (hrs > 0)
|
||||||
|
return hrs + ":" + time;
|
||||||
|
else
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string PrettyTotalTime {
|
private string PrettyTotalTime {
|
||||||
get {
|
get {
|
||||||
|
@ -12,7 +12,6 @@ using System;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using static NadekoBot.Modules.Gambling.Gambling;
|
|
||||||
|
|
||||||
namespace NadekoBot.Modules.Pokemon
|
namespace NadekoBot.Modules.Pokemon
|
||||||
{
|
{
|
||||||
@ -254,7 +253,7 @@ namespace NadekoBot.Modules.Pokemon
|
|||||||
{
|
{
|
||||||
if (!await CurrencyHandler.RemoveCurrencyAsync(user, $"Poke-Heal {target}", amount, true).ConfigureAwait(false))
|
if (!await CurrencyHandler.RemoveCurrencyAsync(user, $"Poke-Heal {target}", amount, true).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
try { await Context.Channel.SendMessageAsync($"{user.Mention} You don't have enough {CurrencyName}s.").ConfigureAwait(false); } catch { }
|
try { await Context.Channel.SendMessageAsync($"{user.Mention} You don't have enough {NadekoBot.BotConfig.CurrencyName}s.").ConfigureAwait(false); } catch { }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,15 +266,15 @@ namespace NadekoBot.Modules.Pokemon
|
|||||||
Stats[targetUser.Id].Hp = (targetStats.MaxHp / 2);
|
Stats[targetUser.Id].Hp = (targetStats.MaxHp / 2);
|
||||||
if (target == "yourself")
|
if (target == "yourself")
|
||||||
{
|
{
|
||||||
await Context.Channel.SendMessageAsync($"You revived yourself with one {CurrencySign}").ConfigureAwait(false);
|
await Context.Channel.SendMessageAsync($"You revived yourself with one {NadekoBot.BotConfig.CurrencySign}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Context.Channel.SendMessageAsync($"{user.Mention} revived {targetUser.Mention} with one {CurrencySign}").ConfigureAwait(false);
|
await Context.Channel.SendMessageAsync($"{user.Mention} revived {targetUser.Mention} with one {NadekoBot.BotConfig.CurrencySign}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await Context.Channel.SendMessageAsync($"{user.Mention} healed {targetUser.Mention} with one {CurrencySign}").ConfigureAwait(false);
|
await Context.Channel.SendMessageAsync($"{user.Mention} healed {targetUser.Mention} with one {NadekoBot.BotConfig.CurrencySign}").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -329,7 +328,7 @@ namespace NadekoBot.Modules.Pokemon
|
|||||||
{
|
{
|
||||||
if (!await CurrencyHandler.RemoveCurrencyAsync(user, $"{user.Mention} change type to {typeTargeted}", amount, true).ConfigureAwait(false))
|
if (!await CurrencyHandler.RemoveCurrencyAsync(user, $"{user.Mention} change type to {typeTargeted}", amount, true).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
try { await Context.Channel.SendMessageAsync($"{user.Mention} You don't have enough {CurrencyName}s.").ConfigureAwait(false); } catch { }
|
try { await Context.Channel.SendMessageAsync($"{user.Mention} You don't have enough {NadekoBot.BotConfig.CurrencyName}s.").ConfigureAwait(false); } catch { }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -362,7 +361,7 @@ namespace NadekoBot.Modules.Pokemon
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Now for the response
|
//Now for the response
|
||||||
await Context.Channel.SendMessageAsync($"Set type of {user.Mention} to {typeTargeted}{targetType.Icon} for a {CurrencySign}").ConfigureAwait(false);
|
await Context.Channel.SendMessageAsync($"Set type of {user.Mention} to {typeTargeted}{targetType.Icon} for a {NadekoBot.BotConfig.CurrencySign}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,8 @@ namespace NadekoBot.Modules.Utility
|
|||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
reminders = uow.Reminders.GetAll().ToList();
|
reminders = uow.Reminders.GetAll().ToList();
|
||||||
|
|
||||||
RemindMessageFormat = uow.BotConfig.GetOrCreate().RemindMessageFormat;
|
|
||||||
}
|
}
|
||||||
|
RemindMessageFormat = NadekoBot.BotConfig.RemindMessageFormat;
|
||||||
|
|
||||||
foreach (var r in reminders)
|
foreach (var r in reminders)
|
||||||
{
|
{
|
||||||
|
@ -281,7 +281,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
.AddField(efb => efb.WithName(Format.Bold("Commands Ran")).WithValue(stats.CommandsRan.ToString()).WithIsInline(true))
|
.AddField(efb => efb.WithName(Format.Bold("Commands Ran")).WithValue(stats.CommandsRan.ToString()).WithIsInline(true))
|
||||||
.AddField(efb => efb.WithName(Format.Bold("Messages")).WithValue($"{stats.MessageCounter} ({stats.MessagesPerSecond:F2}/sec)").WithIsInline(true))
|
.AddField(efb => efb.WithName(Format.Bold("Messages")).WithValue($"{stats.MessageCounter} ({stats.MessagesPerSecond:F2}/sec)").WithIsInline(true))
|
||||||
.AddField(efb => efb.WithName(Format.Bold("Memory")).WithValue($"{stats.Heap} MB").WithIsInline(true))
|
.AddField(efb => efb.WithName(Format.Bold("Memory")).WithValue($"{stats.Heap} MB").WithIsInline(true))
|
||||||
.AddField(efb => efb.WithName(Format.Bold("Owner ID(s)")).WithValue(stats.OwnerIds).WithIsInline(true))
|
.AddField(efb => efb.WithName(Format.Bold("Owner ID(s)")).WithValue(string.Join("\n", NadekoBot.Credentials.OwnerIds)).WithIsInline(true))
|
||||||
.AddField(efb => efb.WithName(Format.Bold("Uptime")).WithValue(stats.GetUptimeString("\n")).WithIsInline(true))
|
.AddField(efb => efb.WithName(Format.Bold("Uptime")).WithValue(stats.GetUptimeString("\n")).WithIsInline(true))
|
||||||
.AddField(efb => efb.WithName(Format.Bold("Presence")).WithValue($"{NadekoBot.Client.GetGuildsCount()} Servers\n{stats.TextChannels} Text Channels\n{stats.VoiceChannels} Voice Channels").WithIsInline(true))
|
.AddField(efb => efb.WithName(Format.Bold("Presence")).WithValue($"{NadekoBot.Client.GetGuildsCount()} Servers\n{stats.TextChannels} Text Channels\n{stats.VoiceChannels} Voice Channels").WithIsInline(true))
|
||||||
#if !GLOBAL_NADEKO
|
#if !GLOBAL_NADEKO
|
||||||
|
@ -38,6 +38,7 @@ namespace NadekoBot
|
|||||||
public static bool Ready { get; private set; }
|
public static bool Ready { get; private set; }
|
||||||
|
|
||||||
public static IEnumerable<GuildConfig> AllGuildConfigs { get; }
|
public static IEnumerable<GuildConfig> AllGuildConfigs { get; }
|
||||||
|
public static BotConfig BotConfig { get; }
|
||||||
|
|
||||||
static NadekoBot()
|
static NadekoBot()
|
||||||
{
|
{
|
||||||
@ -47,6 +48,7 @@ namespace NadekoBot
|
|||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
AllGuildConfigs = uow.GuildConfigs.GetAllGuildConfigs();
|
AllGuildConfigs = uow.GuildConfigs.GetAllGuildConfigs();
|
||||||
|
BotConfig = uow.BotConfig.GetOrCreate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,10 +100,9 @@ namespace NadekoBot
|
|||||||
_log.Info("Connected");
|
_log.Info("Connected");
|
||||||
|
|
||||||
//load commands and prefixes
|
//load commands and prefixes
|
||||||
using (var uow = DbHandler.UnitOfWork())
|
|
||||||
{
|
ModulePrefixes = new ConcurrentDictionary<string, string>(NadekoBot.BotConfig.ModulePrefixes.OrderByDescending(mp => mp.Prefix.Length).ToDictionary(m => m.ModuleName, m => m.Prefix));
|
||||||
ModulePrefixes = new ConcurrentDictionary<string, string>(uow.BotConfig.GetOrCreate().ModulePrefixes.OrderByDescending(mp => mp.Prefix.Length).ToDictionary(m => m.ModuleName, m => m.Prefix));
|
|
||||||
}
|
|
||||||
// start handling messages received in commandhandler
|
// start handling messages received in commandhandler
|
||||||
await CommandHandler.StartHandling().ConfigureAwait(false);
|
await CommandHandler.StartHandling().ConfigureAwait(false);
|
||||||
|
|
||||||
|
@ -348,7 +348,8 @@ namespace NadekoBot.Services
|
|||||||
|
|
||||||
if (module.Name == typeof(Permissions).Name)
|
if (module.Name == typeof(Permissions).Name)
|
||||||
{
|
{
|
||||||
if (!((IGuildUser)context.User).GetRoles().Any(r => r.Name.Trim().ToLowerInvariant() == pc.PermRole.Trim().ToLowerInvariant()))
|
var guildUser = (IGuildUser)context.User;
|
||||||
|
if (!guildUser.GetRoles().Any(r => r.Name.Trim().ToLowerInvariant() == pc.PermRole.Trim().ToLowerInvariant()) && guildUser.Id != guildUser.Guild.OwnerId)
|
||||||
{
|
{
|
||||||
return new ExecuteCommandResult(cmd, pc, SearchResult.FromError(CommandError.Exception, $"You need the **{pc.PermRole}** role in order to use permission commands."));
|
return new ExecuteCommandResult(cmd, pc, SearchResult.FromError(CommandError.Exception, $"You need the **{pc.PermRole}** role in order to use permission commands."));
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ namespace NadekoBot.Services
|
|||||||
var success = await RemoveCurrencyAsync(author.Id, reason, amount);
|
var success = await RemoveCurrencyAsync(author.Id, reason, amount);
|
||||||
|
|
||||||
if (success && sendMessage)
|
if (success && sendMessage)
|
||||||
try { await author.SendErrorAsync($"`You lost:` {amount} {Gambling.CurrencySign}\n`Reason:` {reason}").ConfigureAwait(false); } catch { }
|
try { await author.SendErrorAsync($"`You lost:` {amount} {NadekoBot.BotConfig.CurrencySign}\n`Reason:` {reason}").ConfigureAwait(false); } catch { }
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ namespace NadekoBot.Services
|
|||||||
await AddCurrencyAsync(author.Id, reason, amount);
|
await AddCurrencyAsync(author.Id, reason, amount);
|
||||||
|
|
||||||
if (sendMessage)
|
if (sendMessage)
|
||||||
try { await author.SendConfirmAsync($"`You received:` {amount} {Gambling.CurrencySign}\n`Reason:` {reason}").ConfigureAwait(false); } catch { }
|
try { await author.SendConfirmAsync($"`You received:` {amount} {NadekoBot.BotConfig.CurrencySign}\n`Reason:` {reason}").ConfigureAwait(false); } catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task AddCurrencyAsync(ulong receiverId, string reason, long amount)
|
public static async Task AddCurrencyAsync(ulong receiverId, string reason, long amount)
|
||||||
|
@ -19,11 +19,21 @@ namespace NadekoBot.Services.Database.Models
|
|||||||
public bool RotatingStatuses { get; set; } = false;
|
public bool RotatingStatuses { get; set; } = false;
|
||||||
public string RemindMessageFormat { get; set; } = "❗⏰**I've been told to remind you to '%message%' now by %user%.**⏰❗";
|
public string RemindMessageFormat { get; set; } = "❗⏰**I've been told to remind you to '%message%' now by %user%.**⏰❗";
|
||||||
|
|
||||||
|
//currency
|
||||||
public string CurrencySign { get; set; } = "🌸";
|
public string CurrencySign { get; set; } = "🌸";
|
||||||
public string CurrencyName { get; set; } = "Nadeko Flower";
|
public string CurrencyName { get; set; } = "Nadeko Flower";
|
||||||
public string CurrencyPluralName { get; set; } = "Nadeko Flowers";
|
public string CurrencyPluralName { get; set; } = "Nadeko Flowers";
|
||||||
|
|
||||||
|
public int TriviaCurrencyReward { get; set; } = 0;
|
||||||
|
public int MinimumBetAmount { get; set; } = 3;
|
||||||
|
public float BetflipMultiplier { get; set; } = 1.8f;
|
||||||
|
public int CurrencyDropAmount { get; set; } = 1;
|
||||||
|
public float Betroll67Multiplier { get; set; } = 2;
|
||||||
|
public float Betroll91Multiplier { get; set; } = 3;
|
||||||
|
public float Betroll100Multiplier { get; set; } = 10;
|
||||||
|
public HashSet<CommandPrice> CommandPrices { get; set; } = new HashSet<CommandPrice>();
|
||||||
|
|
||||||
|
|
||||||
public HashSet<EightBallResponse> EightBallResponses { get; set; } = new HashSet<EightBallResponse>();
|
public HashSet<EightBallResponse> EightBallResponses { get; set; } = new HashSet<EightBallResponse>();
|
||||||
public HashSet<RaceAnimal> RaceAnimals { get; set; } = new HashSet<RaceAnimal>();
|
public HashSet<RaceAnimal> RaceAnimals { get; set; } = new HashSet<RaceAnimal>();
|
||||||
|
|
||||||
|
28
src/NadekoBot/Services/Database/Models/CommandPrice.cs
Normal file
28
src/NadekoBot/Services/Database/Models/CommandPrice.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace NadekoBot.Services.Database.Models
|
||||||
|
{
|
||||||
|
public class CommandPrice : DbEntity
|
||||||
|
{
|
||||||
|
public int Price { get; set; }
|
||||||
|
//this is unique
|
||||||
|
public string CommandName { get; set; }
|
||||||
|
|
||||||
|
public override int GetHashCode() =>
|
||||||
|
CommandName.GetHashCode();
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
var instance = obj as CommandPrice;
|
||||||
|
|
||||||
|
if (instance == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return instance.CommandName == CommandName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -234,9 +234,10 @@ namespace NadekoBot.Services.Database
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Protection
|
#region CommandPrice
|
||||||
|
modelBuilder.Entity<CommandPrice>()
|
||||||
|
.HasIndex(cp => cp.Price)
|
||||||
|
.IsUnique();
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ namespace NadekoBot.Services.Impl
|
|||||||
return (await query.ExecuteAsync()).Items.Select(i => i.Id.PlaylistId);
|
return (await query.ExecuteAsync()).Items.Select(i => i.Id.PlaylistId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Regex YtVideoIdRegex = new Regex(@"(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})", RegexOptions.Compiled);
|
private readonly Regex YtVideoIdRegex = new Regex(@"(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11})", RegexOptions.Compiled);
|
||||||
|
|
||||||
public async Task<IEnumerable<string>> GetRelatedVideosAsync(string id, int count = 1)
|
public async Task<IEnumerable<string>> GetRelatedVideosAsync(string id, int count = 1)
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ namespace NadekoBot.Services.Impl
|
|||||||
private ShardedDiscordClient client;
|
private ShardedDiscordClient client;
|
||||||
private DateTime started;
|
private DateTime started;
|
||||||
|
|
||||||
public const string BotVersion = "1.1.0-beta";
|
public const string BotVersion = "1.1.0";
|
||||||
|
|
||||||
public string Author => "Kwoth#2560";
|
public string Author => "Kwoth#2560";
|
||||||
public string Library => "Discord.Net";
|
public string Library => "Discord.Net";
|
||||||
@ -27,7 +27,6 @@ namespace NadekoBot.Services.Impl
|
|||||||
public int TextChannels => _textChannels;
|
public int TextChannels => _textChannels;
|
||||||
private int _voiceChannels = 0;
|
private int _voiceChannels = 0;
|
||||||
public int VoiceChannels => _voiceChannels;
|
public int VoiceChannels => _voiceChannels;
|
||||||
public string OwnerIds => string.Join(", ", NadekoBot.Credentials.OwnerIds);
|
|
||||||
|
|
||||||
Timer carbonitexTimer { get; }
|
Timer carbonitexTimer { get; }
|
||||||
|
|
||||||
@ -111,7 +110,7 @@ namespace NadekoBot.Services.Impl
|
|||||||
Author: [{Author}] | Library: [{Library}]
|
Author: [{Author}] | Library: [{Library}]
|
||||||
Bot Version: [{BotVersion}]
|
Bot Version: [{BotVersion}]
|
||||||
Bot ID: {curUser.Id}
|
Bot ID: {curUser.Id}
|
||||||
Owner ID(s): {OwnerIds}
|
Owner ID(s): {string.Join(", ", NadekoBot.Credentials.OwnerIds)}
|
||||||
Uptime: {GetUptimeString()}
|
Uptime: {GetUptimeString()}
|
||||||
Servers: {client.GetGuildsCount()} | TextChannels: {TextChannels} | VoiceChannels: {VoiceChannels}
|
Servers: {client.GetGuildsCount()} | TextChannels: {TextChannels} | VoiceChannels: {VoiceChannels}
|
||||||
Commands Ran this session: {CommandsRan}
|
Commands Ran this session: {CommandsRan}
|
||||||
|
Loading…
Reference in New Issue
Block a user