Commit 714f8bb0 authored by Vury Leo's avatar Vury Leo Committed by GitHub

feat: add prefix option to tips (#87)

* feat: add prefix option to tips

* revert path

* add default data

* move from data to config

* revert

* redo

* revert whitespeaces
parent b465b5e3
Pipeline #41157 passed with stages
in 13 minutes and 30 seconds
......@@ -70,7 +70,8 @@
"enabled": true,
"get": false,
"interval": 30000,
"interval_ingame": 120000
"interval_ingame": 120000,
"prefix": "Tip: "
},
"dialogues": {
"enabled": true,
......
......@@ -3085,11 +3085,11 @@ wait_room_start_arena = (room)->
#tip
ygopro.stoc_send_random_tip = (client)->
if settings.modules.tips.enabled && tips.tips.length
ygopro.stoc_send_chat(client, "Tip: " + tips.tips[Math.floor(Math.random() * tips.tips.length)])
ygopro.stoc_send_chat(client, "#{settings.modules.tips.prefix}#{tips.tips[Math.floor(Math.random() * tips.tips.length)]}")
await return
ygopro.stoc_send_random_tip_to_room = (room)->
if settings.modules.tips.enabled && tips.tips.length
ygopro.stoc_send_chat_to_room(room, "Tip: " + tips.tips[Math.floor(Math.random() * tips.tips.length)])
ygopro.stoc_send_chat_to_room(room, "#{settings.modules.tips.prefix}#{tips.tips[Math.floor(Math.random() * tips.tips.length)]}")
await return
loadRemoteData = global.loadRemoteData = (loadObject, name, url)->
......
// Generated by CoffeeScript 2.6.1
// Generated by CoffeeScript 2.7.0
(function() {
// 标准库
var Aragami, CLIENT_get_absolute_pos, CLIENT_get_authorize_key, CLIENT_get_kick_reconnect_target, CLIENT_get_partner, CLIENT_heartbeat_register, CLIENT_heartbeat_unregister, CLIENT_import_data, CLIENT_is_able_to_kick_reconnect, CLIENT_is_able_to_reconnect, CLIENT_is_banned_by_mc, CLIENT_is_player, CLIENT_kick, CLIENT_kick_reconnect, CLIENT_pre_reconnect, CLIENT_reconnect, CLIENT_reconnect_register, CLIENT_reconnect_unregister, CLIENT_send_pre_reconnect_info, CLIENT_send_reconnect_info, CLIENT_send_replays, CLIENT_send_replays_and_kick, CLIENT_set_ip, PQueue, Q, ROOM_all, ROOM_bad_ip, ROOM_ban_player, ROOM_clear_disconnect, ROOM_connected_ip, ROOM_find_by_name, ROOM_find_by_pid, ROOM_find_by_port, ROOM_find_by_title, ROOM_find_or_create_ai, ROOM_find_or_create_by_name, ROOM_find_or_create_random, ROOM_kick, ROOM_player_flee, ROOM_player_get_score, ROOM_player_lose, ROOM_player_win, ROOM_players_oppentlist, ROOM_unwelcome, ROOM_validate, ReplayParser, ResolveData, Room, SERVER_clear_disconnect, SERVER_kick, SOCKET_flush_data, YGOProDeck, _, _async, addCallback, aragami, aragami_classes, athleticChecker, auth, axios, badwordR, badwords, ban_user, bunyan, challonge, checkFileExists, createDirectoryIfNotExists, crypto, dataManager, deck_name_match, dialogues, disconnect_list, exec, execFile, extra_mode_list, fs, geoip, getDuelLogQueryFromQs, getRealIp, get_memory_usage, http, httpRequestListener, importOldConfig, import_datas, init, ip6addr, isTrustedProxy, lflists, loadJSON, loadJSONAsync, loadLFList, loadRemoteData, load_dialogues, load_tips, log, long_resolve_cards, memory_usage, merge, moment, moment_long_ago_string, moment_now, moment_now_string, msg_polyfill, neosRequestListener, net, netRequestHandler, os, osu, path, qs, real_windbot_server_ip, release_disconnect, report_to_big_brother, request, roomlist, rooms_count, setting_change, setting_get, setting_save, settings, spawn, spawnSync, spawn_windbot, tips, toIpv4, toIpv6, url, users_cache, util, utility, wait_room_start, wait_room_start_arena, windbot_looplimit, windbot_process, windbots, ygopro, zlib;
......@@ -4104,13 +4104,13 @@
//tip
ygopro.stoc_send_random_tip = async function(client) {
if (settings.modules.tips.enabled && tips.tips.length) {
ygopro.stoc_send_chat(client, "Tip: " + tips.tips[Math.floor(Math.random() * tips.tips.length)]);
ygopro.stoc_send_chat(client, `${settings.modules.tips.prefix}${tips.tips[Math.floor(Math.random() * tips.tips.length)]}`);
}
};
ygopro.stoc_send_random_tip_to_room = async function(room) {
if (settings.modules.tips.enabled && tips.tips.length) {
ygopro.stoc_send_chat_to_room(room, "Tip: " + tips.tips[Math.floor(Math.random() * tips.tips.length)]);
ygopro.stoc_send_chat_to_room(room, `${settings.modules.tips.prefix}${tips.tips[Math.floor(Math.random() * tips.tips.length)]}`);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment