Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Fix an oopsie
Browse files Browse the repository at this point in the history
  • Loading branch information
Wykerd committed Jun 29, 2020
1 parent 3b565c2 commit c55041f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/handlers/advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,17 @@ const advanced_runner = async (message, ast, args) => {
// Discord API
const bscript_config = message._server_doc.bscript;
let messages_sent = 0;
env.def("get_private_channel", async function (msg) {
if (bscript_config.force_channel_messages) return message.channel;
async function get_priv_chan_intern () {
const member = await get_member(message);
const channel = await get_user_channel(message, member);
member.last_message = new Date();
member.channel_id = channel.id;
await member.save();
return channel;
});
}
env.def("get_private_channel", get_priv_chan_intern);
env.def("get_current_channel", async function () {
if (bscript_config.force_channel_messages) return await get_priv_chan_intern();
return message.channel;
});
env.def("send_message", async function (msg, channel) {
Expand Down

0 comments on commit c55041f

Please sign in to comment.