當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript steam.SteamClient類代碼示例

本文整理匯總了TypeScript中steam.SteamClient的典型用法代碼示例。如果您正苦於以下問題:TypeScript SteamClient類的具體用法?TypeScript SteamClient怎麽用?TypeScript SteamClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SteamClient類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

			Collections.Tips.findOne({"recipient.id": chatterID, "unregisteredUser": true}, function(err: Error, tip: any) {
				if (err) {
					bot.sendMessage(chatterID, reportError(err, "Retrieving tip in +accept"));
					return;
				}
				if (!tip) {
					bot.sendMessage(chatterID, "There are no pending tips involving you");
					return;
				}
				async.parallel([
					function(callback) {
						Collections.Tips.update({"_id": tip["_id"]}, {$set: {accepted: true}}, {multi: true}, callback);
					},
					function(callback) {
						// Delete the autoregistered attribute because that user is now fully registered
						Collections.Users.update({"id": chatterID}, {$unset: {"autoregistered": ""}}, callback);
					}
				], function(err: Error) {
					if (err) {
						bot.sendMessage(chatterID, reportError(err, "async.parallel in +accept"));
					}
					bot.sendMessage(chatterID, "Congrats, your tip of " + tip.amount + " Gamerscoins from " + tip.sender.name + " was accepted! Welcome to Gamerscoin next generation Trade community");
					bot.sendMessage(chatterID, "You can open up the group chat and double click on my name in the sidebar (with the gold star) to send me commands in the future.");
					bot.sendMessage(chatterID, "Send '+help' to see all of the available commands.");
					bot.sendMessage(chatterID, "If you have any questions or suggestions, please start a discussion within the group. RazeTheRoof <petschekr@gmail.com> is this bot's author so send any hate/love mail his way.");
				});
			});
開發者ID:hilmysyarif,項目名稱:GamersSteamTipBot,代碼行數:27,代碼來源:bot.ts

示例2: function

bot.on('loggedOn', function ()
{
	console.log("Success Fully logged on!");
	bot.setPersonaState(Steam.EPersonaState.Online); // to display your bot's status as "Online"
	bot.setPersonaName(STEAMNAME); // to change its nickname

});
開發者ID:azarus,項目名稱:AdminReports,代碼行數:7,代碼來源:app.ts

示例3:

		setTimeout(function(): void {
			bot.sendMessage(steamID, "Go to the GamersTradeBase Tip group to message me. I can't accept friend requests.");
			bot.sendMessage(steamID, "Removing friend...");
			setTimeout(function(): void {
				bot.removeFriend(steamID);
			}, 2000);
		}, 2000);
開發者ID:hilmysyarif,項目名稱:GamersSteamTipBot,代碼行數:7,代碼來源:bot.ts

示例4: stringifyAndEscape

							gamerscoin.move(giveawayInfo.account, chatterID, amountToGive, 1, stringifyAndEscape(tipComment), function(err: any, success: boolean) {
								if (err) {
									bot.sendMessage(chatterID, reportError(err, "Moving balance for a giveaway"));
									return;
								}
								bot.sendMessage(chatterID, "As part of the current giveaway, you've been given " + amountToGive + " Gamerscoin! You can use that Gamerscoins to tip others on Steam and help spread the word!");
							});
開發者ID:hilmysyarif,項目名稱:GamersSteamTipBot,代碼行數:7,代碼來源:bot.ts

示例5: if

					gamerscoin.sendFrom(chatterID, donationAddress, donationAmount, function(err: any, txid: string) {
						if (err) {
							if (err.code === -4) {
								// Wallet probably doesn't have enough funds
								reportError({message: "Insufficient server funds to complete donation request", id: chatterID, address: donationAddress, amount: donationAmount}, "Donating funds");
								bot.sendMessage(chatterID, "Sorry, the server doesn't have enough funds currently to complete that request. Most of the server's funds are kept offline in cold wallets to increase security. This bot's maintainer (RazeTheRoof) has been notified of the server's insufficient balance. He will fix this shortly. If this problem persists, please don't hesitate to email him at <petschekr@gmail.com>.");
							}
							else if (err.code === -6) {
								bot.sendMessage(chatterID, "You have insufficient funds to donate " + donationAmount + " Gamerscoins");
								bot.sendMessage(chatterID, "Your current balance is: " + balance + " Gamerscoins");
							}
							else {
								bot.sendMessage(chatterID, reportError({code: err.code, id: chatterID, address: donationAddress, amount: donationAmount}, "Donating funds"));
							}
							return;
						}
						bot.sendMessage(chatterID, "Your donation of " + donationAmount + " Gamerscoins was successfully donated. (Donation address: " + donationAddress + ")\nTxID for this donation is: " + txid + "\nThank you very much for your support of this project.");
						// Record the donation in the database
						Collections.Donations.insert({
							"sender": {
								"name": user.name,
								"id": chatterID
							},
							"amount": donationAmount,
							"USD": donationAmount * prices["GMC/USD"],
							"timestamp": Date.now(),
							"time": new Date().toString(),
							"groupID": GamersTipGroupID,
						}, {w:1}, function(err): void {
							if (err) {
								err.txid = txid;
								bot.sendMessage(chatterID, reportError(err, "Inserting donation into the database"));
								return;
							}
						});
						// Reimburse the user for their transaction fee
						gamerscoin.getTransaction(txid, function(err: any, txInfo: any) {
							if (err) {
								bot.sendMessage(chatterID, reportError(err, "Retrieving tx info in +donate"));
								return;
							}
							var fee: number = Math.abs(txInfo.fee);
							if (fee === 0) {
								bot.sendMessage(chatterID, "The transaction fee was 0 Gamerscoins");
								return;
							}
							gamerscoin.move("FeePool", chatterID, fee, function(err: any, success: boolean) {
								if (err) {
									bot.sendMessage(chatterID, reportError(err, "Reimbursing the user for their transaction fee"));
									return;
								}
								bot.sendMessage(chatterID, "The transaction fee of " + fee + " Gamerscoins has been reimbursed");
							});
						});
					});
開發者ID:hilmysyarif,項目名稱:GamersSteamTipBot,代碼行數:55,代碼來源:bot.ts


注:本文中的steam.SteamClient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。