Morelo Network Discord bot.
- Install Node.js 20 or later and run
pnpm install. - Copy
config.sample.jstoconfig.js. - Configure both Discord bot tokens, the daemon and wallet RPC endpoints (or
local binaries), and the wallet directory/name/password. For a local wallet
RPC, set
walletRpcPortas needed. - In the Discord Developer Portal, enable the privileged Message Content, Server Members and Presence intents.
- Start the bot with
pnpm start.
All tip balances live in one wallet. Discord user accounts are mapped through
walletUsersPath; existing mappings can be imported from legacyAddressesPath.
Back up both the wallet files and the configured mapping file.
The wallet RPC must be private and trusted: the bot uses it to create accounts
and send real MRL transactions. Never expose an unauthenticated wallet RPC to
the internet. When walletURL is empty, the bot uses a wallet RPC already
listening on 127.0.0.1:walletRpcPort, or starts one and stops it on shutdown.
If the wallet RPC already has a wallet open, the bot uses that wallet;
walletName and walletPassword are used only when it needs to open one.
Users can receive DMs for incoming transfers and control tip/transfer alerts
with the notifications command. The notification store tracks transaction
pool message IDs and transfer history, and backfills existing transfers once.
Slash commands are registered at startup. Message commands use the configured
prefix or a bot mention (set prefixMention to false to make a mention only
show the greeting). Every slash command also has a variant ending with d, for
example /balanced, whose response is visible only to you; for message
commands the hidden response is sent as a direct message.
network,hashrate,difficulty,pools: network, price and mining pool statistics.address: your deposit address (always hidden).balance [@user]: unlocked and locked balance.tip <@user|@role> <amount>: send MRL to a user, or split it evenly among the human members of a role.tipall <amount>: split MRL evenly among online human members of the server.withdraw <address> <amount|all>(aliastransfer): send MRL to an external address (always hidden).allsends the whole unlocked balance minus the fee.usage(aliaseshelp,commands),ping,uptime.
Amounts accept up to 9 decimal places. Group tips are sent in a single transfer, so either every recipient is paid or none is; atomic units that can't be split evenly stay with the sender. Received MRL is locked for a few blocks before it can be sent again.
Set statsTextChannel to post and periodically update a combined statistics
message, and statsChannels to show single values as channel names.
Prices come from the provider named by priceProvider, a module in
price-providers/ (empty disables prices). To add a provider, create
price-providers/<name>.js exporting { name, async getPrice(config) }, where
getPrice resolves to { usd, volume24hUSD?, change24h? } (numbers) and
throws on failure.