bot.wait_for("reaction_add")
: https://discordpy.readthedocs.io/en/v1.3.4/api.htm...@bot.command(ctx):
async def test(ctx):
accept_decline = await ctx.send('Test')
await accept_decline.add_reaction('one')
try:
reaction = await bot.wait_for("reaction_add", timeout=60, check = lambda r, u: r=='one' )
except asyncio.TimeoutError:
await channel.send("\N{THUMBS DOWN SIGN}")
else:
await channel.send("\N{THUMBS UP SIGN}")
const newArr = arr.reduce((acc, n, i) => (acc.push(n + (acc[i - 1] ?? 0)), acc), []);
// или
const newArr = arr.reduce((acc, n) => (acc[0].push(acc[1] += n), acc), [ [], 0 ])[0];
// или
const newArr = arr.map((n, i, a) => eval(a.slice(0, i + 1).join('+')));
// или
const newArr = arr.map((n, i, a) => a.reduce((acc, m, j) => acc + m * (j <= i), 0));
arr.forEach((n, i, a) => a[i] += a[i - 1] ?? 0);
function Generate(s) {
if(s.length === 1) return [s];
const ans = [];
const last = s[s.length - 1];
s = s.slice(0, s.length - 1);
const prev = Generate(s);
for (const entry of prev) {
ans.push(entry + last);
ans.push(entry + '.' + last);
}
return ans;
}
INSERT INTO RESULTS (UNIXDATE, ACTION, CURRENCY, AMOUNT)
SELECT bb.UNIXDATE, 'BUY', 'BTC', bb.AMOUNT FROM BTC_BUY bb
UNION ALL
SELECT bs.UNIXDATE, 'SELL', 'BTC', bs.AMOUNT FROM BTC_SELL bs
UNION ALL
SELECT eb.UNIXDATE, 'BUY', 'ETH', eb.AMOUNT FROM ETH_BUY eb
UNION ALL
SELECT es.UNIXDATE, 'SELL', 'ETH', es.AMOUNT FROM ETH_SELL es
ORDER BY UNIXDATE ASC;