mirror of
				https://github.com/keanuplayz/TravBot-v3.git
				synced 2024-08-15 02:33:12 +00:00 
			
		
		
		
	Rename insurance field
This commit is contained in:
		
							parent
							
								
									1351f3250b
								
							
						
					
					
						commit
						dc33dbd180
					
				
					 3 changed files with 10 additions and 10 deletions
				
			
		|  | @ -96,8 +96,8 @@ export const BetCommand = new Command({ | ||||||
|                             sender.money -= amount; |                             sender.money -= amount; | ||||||
|                             receiver.money -= amount; |                             receiver.money -= amount; | ||||||
|                             // Very hacky solution for persistence but better than no solution, backup returns runs during the bot's setup code.
 |                             // Very hacky solution for persistence but better than no solution, backup returns runs during the bot's setup code.
 | ||||||
|                             sender.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled += amount; |                             sender.ecoBetInsurance += amount; | ||||||
|                             receiver.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled += amount; |                             receiver.ecoBetInsurance += amount; | ||||||
|                             Storage.save(); |                             Storage.save(); | ||||||
| 
 | 
 | ||||||
|                             // Notify both users.
 |                             // Notify both users.
 | ||||||
|  | @ -141,8 +141,8 @@ export const BetCommand = new Command({ | ||||||
|                                         receiver.money += amount; |                                         receiver.money += amount; | ||||||
|                                         channel.send(`By the people's votes, <@${target.id}> couldn't be determined to have won or lost the bet that <@${author.id}> had sent them.`); |                                         channel.send(`By the people's votes, <@${target.id}> couldn't be determined to have won or lost the bet that <@${author.id}> had sent them.`); | ||||||
|                                     } |                                     } | ||||||
|                                     sender.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled -= amount; |                                     sender.ecoBetInsurance -= amount; | ||||||
|                                     receiver.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled -= amount; |                                     receiver.ecoBetInsurance -= amount; | ||||||
|                                     Storage.save(); |                                     Storage.save(); | ||||||
|                                 }); |                                 }); | ||||||
|                             }, duration); |                             }, duration); | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ class User { | ||||||
|     public lastMonday: number; |     public lastMonday: number; | ||||||
|     public timezone: number | null; // This is for the standard timezone only, not the daylight savings timezone
 |     public timezone: number | null; // This is for the standard timezone only, not the daylight savings timezone
 | ||||||
|     public daylightSavingsRegion: "na" | "eu" | "sh" | null; |     public daylightSavingsRegion: "na" | "eu" | "sh" | null; | ||||||
|     public quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled: number; |     public ecoBetInsurance: number; | ||||||
| 
 | 
 | ||||||
|     constructor(data?: GenericJSON) { |     constructor(data?: GenericJSON) { | ||||||
|         this.money = select(data?.money, 0, Number); |         this.money = select(data?.money, 0, Number); | ||||||
|  | @ -36,7 +36,7 @@ class User { | ||||||
|         this.daylightSavingsRegion = /^((na)|(eu)|(sh))$/.test(data?.daylightSavingsRegion) |         this.daylightSavingsRegion = /^((na)|(eu)|(sh))$/.test(data?.daylightSavingsRegion) | ||||||
|             ? data?.daylightSavingsRegion |             ? data?.daylightSavingsRegion | ||||||
|             : null; |             : null; | ||||||
|         this.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled = select(data?.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled, 0, Number); |         this.ecoBetInsurance = select(data?.ecoBetInsurance, 0, Number); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -19,10 +19,10 @@ export default new Event<"ready">({ | ||||||
|         for (const id in Storage.users) { |         for (const id in Storage.users) { | ||||||
|             const user = Storage.users[id]; |             const user = Storage.users[id]; | ||||||
| 
 | 
 | ||||||
|             if(user.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled > 0) { |             if(user.ecoBetInsurance > 0) { | ||||||
|                 client.users.cache.get(id)?.send(`Because my system either crashed or restarted while you had a pending bet, the total amount of money that you bet, which was \`${user.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled}\`, has been restored.`); |                 client.users.cache.get(id)?.send(`Because my system either crashed or restarted while you had a pending bet, the total amount of money that you bet, which was \`${user.ecoBetInsurance}\`, has been restored.`); | ||||||
|                 user.money += user.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled; |                 user.money += user.ecoBetInsurance; | ||||||
|                 user.quoteUnquoteSoCalledInsuranceForEcoBetIfItEvenCanBeSoCalled = 0; |                 user.ecoBetInsurance = 0; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         Storage.save(); |         Storage.save(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue