コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
347 ビュー

hello

I want to add button in discuss channel chat near to notification settings button that do some python code 
how do this?

アバター
破棄
著作者

i try this code
threadActionsRegistry.add("custom_action", {
condition(component) {
// Show only in channel threads
return component.thread?.model === "discuss.channel";
},
async onClick(ev) {
const orm = useService("orm");
const notification = useService("notification");

try {

const result = this.orm.call(
"discuss.channel", // Model name
"chatbot_inactive", // Method name
[session.uid,ev], // Arguments

);

notification.add(result.message, { type: "success" });
} catch (error) {
notification.add(_t("Action failed"), { type: "danger" });
}
},

icon: "fa fa-fw fa-file", // Change icon as needed
name: _t("Custom Action"), // Button tooltip

});
that add button but nothing happen when i click it

著作者 最善の回答

no answer

アバター
破棄